cpp(lib) vs. pedantic warnings vs. -Werror.

Neil Booth neil@daikokuya.demon.co.uk
Thu Jan 11 15:26:00 GMT 2001


Chris G . Demetriou wrote:-

> it looks like there are a bunch of calls in cpp to cpp_pedwarn() which
> aren't guaded with checks of the CPP pedantic flag.  (but, there are
> at least some calls which are guarded...)
 
;-)
 
> So, I guess the question is, what's the expected behaviour in CPP, and
> is this a known issue, and what's the Right solution?

It's intentional, but I find it exceedingly confusing too.  pedwarn
will upgrade to an error if -pedantic-errors, unlike a warning.
Otherwise it's just like a warning.

The idea is that if it's a pedwarn, a diagnostic of some form is
required by the standard.  If we guard it with a check for -pedantic,
we feel it really is pedantic and that a normal user wouldn't care.

It's further confused because we suppress all warnings in system
headers regardless :-)

I'd like to have a single function, say cpp_diagnostic, that takes a
severity flag, with slightly finer control on diagnostic types than we
have now.  It should eventually all be integrated with the front ends,
too, but one step at a time.

Neil.


More information about the Gcc mailing list