[Bug] Compiler error when accessing packed array element
The following program: program bug; type r = packed record a : char; b : array [1..4] of char end; var v : r; i : integer; c : char; begin c := v.a; { line 13: succeeds } c := v.b [1]; { line 14: succeeds } c := v.b [i]; { line 15: fails } end. ...gives this improper compile-time error: bug.pas: In main program: bug.pas:15: cannot take address of packed record field `b' This is with gpc version 20030507, based on gcc-3.2.3 (mingw special 20030504-1), configured for i486-pc-mingw32. I also reproduced this with the Chief's gpc-20030507-gcc-3.2.3-i386-pc-mingw32.tar.gz. -- Dave
J. David Bryan wrote:
The following program:
program bug;
type r = packed record a : char; b : array [1..4] of char end;
var v : r; i : integer; c : char;
begin c := v.a; { line 13: succeeds } c := v.b [1]; { line 14: succeeds } c := v.b [i]; { line 15: fails } end.
...gives this improper compile-time error:
bug.pas: In main program: bug.pas:15: cannot take address of packed record field `b'
This is with gpc version 20030507, based on gcc-3.2.3 (mingw special 20030504-1), configured for i486-pc-mingw32. I also reproduced this with the Chief's gpc-20030507-gcc-3.2.3-i386-pc-mingw32.tar.gz.
http://gnu-pascal.de/crystal/gpc/en/mail8737.html Frank -- Frank Heckenbach, frank@g-n-u.de, http://fjf.gnu.de/, 7977168E GPC To-Do list, latest features, fixed bugs: http://www.gnu-pascal.de/todo.html GPC download signing key: 51FF C1F0 1A77 C6C2 4482 4DDC 117A 9773 7F88 1707
On 7 Jul 2003 at 5:06, Frank Heckenbach wrote:
Ah, yes. Thanks. -- Dave
participants (2)
-
Frank Heckenbach -
J. David Bryan