This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: cpp(lib) vs. pedantic warnings vs. -Werror.
- To: "Chris G. Demetriou" <cgd at sibyte dot com>
- Subject: Re: cpp(lib) vs. pedantic warnings vs. -Werror.
- From: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Date: Thu, 11 Jan 2001 23:26:37 +0000
- Cc: gcc at gcc dot gnu dot org
- References: <yov58zohaf9s.fsf@highland.sibyte.com>
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.