Here's a more serious problem I've found while attempting to port a "legacy" application (250,000 LOC) to GNU Pascal:
FILE: test1.pas UNIT Test1;
INTERFACE
TYPE eFlagDefs = (IDEInterface,DoubleDensity,HighDensity); sFlagDefs = SET OF eFlagDefs;
FUNCTION GetFlagVal : eFlagDefs;
IMPLEMENTATION END.
FILE: test.pas PROGRAM Test; USES Test1;
VAR Flags : sFlagDefs;
BEGIN Flags := [IDEInterface,HighDensity]; IF IDEInterface IN Flags THEN WRITELN ('IDE Interface');
IF GetFlagVal IN [HighDensity,DoubleDensity] THEN WRITELN ('Dump Core'); END.
test.pas: In function `program_Test': test.pas:9: type of set constructor element must be the set basetype test.pas:9: type of set constructor element must be the set basetype test.pas:9: aggregate value used where an integer was expected test.pas:10: invalid operands to binary `in' test.pas:10: condition must be of Boolean type gpc: Internal compiler error: program gpc1 got fatal signal 11
Problem seems to be related to performing operations on "set elements" when defined in an external UNIT. Note that the same functions appear to work when all defined in one unit.
Phil
------------------------------------------------------------------------- Philip A. Robertson phil_robertson@gilbarco.com Gilbarco Inc. F-78 Phone (910) 547-5164 7300 W. Friendly Ave Fax (910) 292-8871 Greensboro, NC 27410 -------------------------------------------------------------------------