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...


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



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