The following program used to work:
PROGRAM FOO; CONST IDLNGTH = 12; TYPE ALPHA = ARRAY [1..IDLNGTH] OF CHAR; IDENTIFIER = PACKED RECORD NAME: ALPHA; END; VAR FILID : IDENTIFIER ; I, J : INTEGER;
BEGIN J := 0 ; FOR I := 1 TO IDLNGTH DO J := J + ORD(FILID.NAME[I]) ; WRITELN('OK') END .
With gpc-20030507 I get the following:
bash-2.04$ gpc -v -B/mnt/a9/pom/kompi/gcc3/gpc-3.2.2/gcc name4.p Reading specs from /mnt/a9/pom/kompi/gcc3/gpc-3.2.2/gcc/specs Configured with: ../gcc-3.3/configure --enable-checking Thread model: posix gpc driver version 20030507, based on gcc-3.3, executing gpc version 3.2.2 /mnt/a9/pom/kompi/gcc3/gpc-3.2.2/gcc/gpcpp -D__BITS_LITTLE_ENDIAN__=1 -D__BYTES_LITTLE_ENDIAN__=1 -D__WORDS_LITTLE_ENDIAN__=1 -D__NEED_NO_ALIGNMENT__=1 -v -isystem /mnt/a9/pom/kompi/gcc3/gpc-3.2.2/gcc/include -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=2 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -Acpu=i386 -Amachine=i386 -Di386 -D__i386 -D__i386__ -D__tune_i686__ -D__tune_pentiumpro__ name4.p -famtmpfile=/tmp/ccZIDfUy.gpa /tmp/ccKpUnOZ.i GNU Pascal Compiler PreProcessor version 20030507, based on gcc-3.2.2 (i386 Linux/ELF) /mnt/a9/pom/kompi/gcc3/gpc-3.2.2/gcc/gpc1 /tmp/ccKpUnOZ.i -quiet -dumpbase name4.p -version -famtmpfile=/tmp/ccZIDfUy.gpa -o /tmp/ccXcnQqq.s GNU Pascal version is actually 20030507, based on gcc-3.2.2 GNU Pascal version 3.2.2 (i686-pc-linux-gnu) compiled by GNU C version 3.3. name4.p: In main program: name4.p:15: cannot take address of packed record field `NAME'
Waldek Hebisch wrote:
The following program used to work:
PROGRAM FOO; CONST IDLNGTH = 12; TYPE ALPHA = ARRAY [1..IDLNGTH] OF CHAR; IDENTIFIER = PACKED RECORD NAME: ALPHA; END; VAR FILID : IDENTIFIER ; I, J : INTEGER;
BEGIN J := 0 ; FOR I := 1 TO IDLNGTH DO J := J + ORD(FILID.NAME[I]) ; WRITELN('OK') END .
With gpc-20030507 I get the following:
name4.p:15: cannot take address of packed record field `NAME'
Fix.
Frank
Thanks, the fix works for me.