This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: once we have cpplib...
- To: Per Bothner <bothner at cygnus dot com>
- Subject: Re: once we have cpplib...
- From: Dave Brolley <brolley at cygnus dot com>
- Date: Mon, 13 Apr 1998 12:43:37 -0400
- CC: Ulrich Drepper <drepper at cygnus dot com>, law at cygnus dot com, egcs at cygnus dot com
- Organization: Cygnus Solutions Canada Ltd
- References: <199804100444.VAA12731@cygnus.com>
Per Bothner wrote:
> The main difference between cc1 needs to know whether it should
> pre-process the input is if it sees an identifier that matches a builtin
> macro - should that be expanded or not? Since such macros tend to be
> in the implementor's name-space, I can't think of valid code which would
> be harmed by having cc1 do the macro-expansion, even if it already was
> processed by cpp.
I agree with this opinion. The compilers I have worked on that had had an
integrated preprocessor never bothered to check and I don't recall seeing any
problems along these lines.
> But there is an easy way cc1 can tell if the input was already
> processed by cpp: Look at the first line. If it looks like:
> # 1 "foo.c"
> then it is cpp output, since such a line is not a valid
> pre-processor directive, I believe.
It's accepted by many older compilers/preprocessors.
Dave