One of my programs works fine with GPC2.1/gcc2.95.3
it does not compile with 2003/03/23
I could isolate the problem (out of a 5000 lines source)
to two small units (see below)
The original unit declaz contains global variables and procedure common to
almost all the rest of the program.
Ttwo of its (public) variables are masked in the implementation part of
another unit by a variable with the same name (not a bug).
There is a warning for this situation: fine, but not so fine, all the
variables declared after the warning are ignored, and trigger errors when
they appear later.
To see it happen, copy the two sources below as gdeclaz.pas and gimpragr.pas,
and try
gpc --automake -c gimpragr.pas
I get
jp@brea:~/agreg/src/pascal> gpc --automake -c gimpragr.pas
gimpragr.pas:21: redeclaration of `l132'
gdeclaz.pas:6: previous declaration
gimpragr.pas: In procedure `presidence':
gimpragr.pas:23: undeclared identifier `president' (first use in this routine)
gimpragr.pas:23: (Each undeclared identifier is reported only once
gimpragr.pas:23: for each routine it appears in.)
gimpragr.pas:23: undeclared identifier `presidente' (first use in this
routine)
*****************************************************************************
unit gdeclaz;
interface
var
l132 : boolean;
implementation
END.
*********************************************************************************
Unit gimpragr;
Interface
Procedure impression;
Implementation
Uses gdeclaz;
Var
l132, president,presidente,chrono: Boolean;
Procedure presidence;
Begin
If Not (president Or presidente) Then
Begin
write('La présidence est elle tenue par un homme ou une femme H/F ?
');
End;
End; { presidence }
procedure impression;
Begin
writeln('impression');
end;
END.
******************************************************************************************
--
Jean-Pierre Vial