Running gpc-20060325 on i486-pc-mingw32 (gcc-3.4.6), I wish to use an "asm" statement and the predefined identifiers "Cardinal" and "ParamCount" in an Extended Pascal program. However, the following program fails to compile:
{$ extended-pascal } {$ enable-keyword asm } {$ enable-predefined-identifier Cardinal } {$ enable-predefined-identifier ParamCount }
program Predefs;
var C : Cardinal; I : integer;
begin asm ('nop'); I := ParamCount; C := 1 end.
With "gpc -c predefs.pas", I get:
predefs.pas:1: warning: compiler directives are a UCSD Pascal extension predefs.pas: In main program: predefs.pas:12: error: `asm' is an extension of Borland Pascal, traditional predefs.pas:12: error: Macintosh Pascal predefs.pas:13: error: `ParamCount' is an extension of Borland Pascal
Note from the above that "Cardinal" is being enabled by the directives, whereas "ParamCount" and "asm" are not.
I get the same results if I specify the compiler switches on the command line (e.g., "--enable-keyword=asm", etc.) instead of within the program. I see the same behavior with gpc-20051116.
Is this a compiler bug, or am I doing something wrong?
-- Dave