Thanks,
It is a problem because the compiler substitutes even after the keyword import! It shouldn't do this. Am I right?
-----Original Message----- From: Frank Heckenbach [mailto:frank@g-n-u.de] Sent: Saturday, August 09, 2003 10:41 AM To: gpc@gnu.de Subject: Re: Problem on solaris
Mehdi Khaldi wrote:
I work on a Solaris 7 plateform. GPC features are gpc version 2.1 (20020510), based on 2.95.2 19991024 (release)
I have one module called sun.p :
Module SUN INTERFACE;
export SUN = all;
procedure myproc;
CONST Max = 32767; Min = -32768; End.
Module SUN IMPLEMENTATION;
Procedure myproc; Begin Writeln('allo'); End;
End.
I have one main program :
program essai;
import sun;
begin end.
When I compile with gpc. I get an error : ./src/testpascal.p:3: parse
error
before `1'
When I watch the temporaries files, actually testpascal.i, I see "import sun" was switched by "import 1".
What's wrong?
As you can see with `-v', there are some default defines, including `sun' on a Sun. These are actually macros with value 1.
You can disable macros in genral using `--no-macros'. But I'd recommend to rename the unit, since `Sun' is probably too general a name, anyway ...
Frank
Mehdi Khaldi wrote:
It is a problem because the compiler substitutes even after the keyword import! It shouldn't do this.
Macros are substituted everywhere. They're not a compiler but a preprocessor feature.
What does "--no-macros" means? Are all macros undefined?
See doc.
Frank