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]

Re: once we have cpplib...


> 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


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