On 24 Oct 2005 at 5:59, Waldek Hebisch wrote:
I just checked that Free Pascal accepts the followig program:
program keyw; var absolute, external, overload, override, virtual, abstract, reintroduce : integer; begin end .
gpc -fdelphi says:
keyw.p:2: error: `absolute' is a keyword in Borland Pascal keyw.p:2: error: `external' is a keyword in UCSD Pascal, Borland Pascal, keyw.p:2: error: traditional Macintosh Pascal keyw.p:2: error: `virtual' is a keyword in Object Pascal, Borland Pascal, keyw.p:2: error: traditional Macintosh Pascal
It seems that all of them as treated as "directives" and hence may work also as variable names.
Could some kind soul check how other compilers behave -- if the names are really directives then we should teach gpc to accept them as variable names in those dialects.
Delphi compiles it, but with these "hints": Hint: Variable 'absolute' is declared but never used in 'keyw' Hint: Variable 'external' is declared but never used in 'keyw' Hint: Variable 'overload' is declared but never used in 'keyw' Hint: Variable 'override' is declared but never used in 'keyw' Hint: Variable 'virtual' is declared but never used in 'keyw' Hint: Variable 'abstract' is declared but never used in 'keyw' Hint: Variable 'reintroduce' is declared but never used in 'keyw'
BTW, FPC gives the same hints (called "Note") as Delphi.
BP accepts it without any complaint.
Best regards, The Chief -------- Prof. Abimbola A. Olowofoyeku (The African Chief) web: http://www.greatchief.plus.com/