cpp discrepancies
Marc Espie
Marc.Espie@liafa.jussieu.fr
Wed Apr 28 07:32:00 GMT 1999
Just to put things in context, I didn't try to find all those problems.
It's simply that OpenBSD features a lint that invokes cpp directly,
hence noticing that -undef was gone from the internal pre-processor,
I proceeded to use the new cpp, and ran into ALL the problems I mentioned.
On Wed, Apr 28, 1999 at 12:28:10AM -0400, Zack Weinberg wrote:
> Specifically referring to cpp, the discrepancies you note are because
> cpp.texi/cpp.1 document the interface to the internal binary, and they
> don't get it exactly right either.
That cpp.1 document that simply source cccp.1 doesn't help.
There should be a definite warning in the source that cccp is *internal*
and not meant to be used... having a man page for an internal program
is an error, imo, unless it is quite clearly labelled as internal.
> That `xcpp' executable is a
> "language-specific driver" which in this case means it behaves exactly
> like `gcc' except it has the -E switch automatically turned on.
> Therefore, you select the language with -x, and __GNUC__ is always
> defined, etc. etc.
> I can fix all of the discrepancies you reported, but there's a big fat
> caveat: doing so will change the behavior of `gcc' as well, in the
> following ways:
> * -$ will be recognized and passed on to the preprocessor (not the
> compiler-proper, which doesn't understand it).
Probably not needed. Documentation upgrade is fine.
> * -lang-FOO will behave exactly like -xFOO. People who have libraries
> named "libang-FOO.a" will lose.
Ditto
> * There will be a new switch, -no-gcc. Passing this switch will cause
> the driver not to define __GNUC__ and __GNUC_MINOR__.
Definitely unneeded. Documenting that even with -undef __GNUC__ and
__GNUC_MINOR__ are defined is mandatory, on the other hand. Nasty
surprise... this is the one that definitely bit me and took me an hour
to figure out...
> Are there any objections to these changes? Do they require waiting
> for 1.3?
Documentation change is mostly fine by me...
Don't forget to either fix IN-FILE OUT-FILE, or fix the documentation
as well :)
--
Marc Espie
|anime, sf, juggling, unicycle, acrobatics, comics...
|AmigaOS, OpenBSD, C++, perl, Icon, PostScript...
| `real programmers don't die, they just get out of beta'
More information about the Gcc
mailing list