This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: Change in preprocessor behavior



I may be wrong (I don't have a machine close by with gcc on).

Try adding the -v flag to your compile.
This shows all the flags passed to the underlying frontend (cc1plus)


Then you can compare the flags used on Solaris and OS-X.

You will then be able to see if -traditional is being passed
to cc1plus on your OS-X machine



I also believe you can override the flags passed to the frontend
by specifying a specs file on the command line (though I have never
tried this myself). This may be simpler then rebuilding gcc.


Martin.

-----Original Message-----
From: Stephen Lindholm [mailto:lindholm@CS.Stanford.EDU]
Sent: 30 December 2002 18:46
To: Neil Booth
Cc: gcc@gcc.gnu.org
Subject: Re: Change in preprocessor behavior



I'm using the version of gcc which came with Mac OS X, and I compared it
to the old version of gcc installed on the Solaris mail server. I did not
install either of the two compilers myself.

I did cut and paste the command line and output exactly as they were in
the terminal window.

I guess the OS X compiler came out of the box configured differently than
I expected. I know it has some modifications to support Mac programming,
but I did not expect the preprocessor to be configured differently. I
guess I will just have to use a different computer for my preprocessing or
install another version of gcc.

Thank you for your help.


On Mon, 30 Dec 2002, Neil Booth wrote:

> Stephen Lindholm wrote:-
> 
> > thrush:~% cpp test2
> > # 1 "test2"
> > 
> >       
> > struct command commands[] =
> > {
> >   { #quit, quit ## _command },
> >   { #help, help ## _command },
> > };
> 
> Contrary to your claim, I suspect you're using cpp -traditional, no?
> 
> Traditional preprocessors did not support # and ##, and 3.1 is more
> "correct" in this respect.  FWIW 3.3 has another new implementation of
> traditional preprocessing which is the most faithful of GCC's
> implementations to true traditional preprocessing.
> 
> Neil.
> 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]