This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: once we have cpplib...
- To: drepper at cygnus dot com (Ulrich Drepper)
- Subject: Re: once we have cpplib...
- From: Per Bothner <bothner at cygnus dot com>
- Date: Thu, 09 Apr 1998 21:44:32 -0700
- cc: law at cygnus dot com, egcs at cygnus dot com, brolley at cygnus dot com
> I think there is an easy way to keep compatibility. When the
> integrated cpp is supposed to be used give cc1 (cc1plus, ...) an extra
> argument.
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.
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.
--Per Bothner
Cygnus Solutions bothner@cygnus.com http://www.cygnus.com/~bothner