In message <5C2561AB.20010308004600.FOO-6C90.frank(a)g-n-u.de>
Frank Heckenbach writes:
> David James wrote:
>
> > I'm trying to upgrade from gpc version 19991030 to 20010306 both
> > based on 2.95.2 19991024 (released).
> >
> > It looks as if 'class' has become a reserved word, which is
> > unfortunate as it is a variable name our code uses frequently.
> >
> > First question: is class now reserved in some way?
>
> Yes (Delphi compatibility).
>
[snip]
>
> I think it's only "conditionally reserved" (like many keywords from
> various dialects are). E.g., `var Class: Integer;' seems to work.
> But I'm not sure in which situations it works and in which it
> doesn't (optimally, in all those situations where it can't be
> confused with a class type declaration). Could you post some
> problematic example code?
Here's about the simplest case I can come up with quickly ...
test5.p
=======
program test_class;
type tcomp=packed record
name:string[80];
class:1..15;
end;
var comp:tcomp;
begin
end.
I get:
test5.p:5: parse error before `Class'
test5.p:5: extra semicolon
>
> > Third question: any thoughts on whether there any other syntax changes
> > I might trip over?
>
> Have you checked the `News' chapter of the manual, in particular the
> first section and all items marked with `(@)' (as explained there)?
Yes, I've scanned it rapidly - I didn't find any mention of 'class'
there (which is why I asked if there was anything else I might trip
over), but I could easily have missed it.
--
David James
mailto:david@tcs01.demon.co.uk
Special Stage Rally results archive <URL:http://www.tcs01.demon.co.uk/>