This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: 3.2 cpplib: Permit directives in macro args
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Neil Booth <neil at daikokuya dot demon dot co dot uk>
- Cc: <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 27 Feb 2002 00:36:55 +0000 (GMT)
- Subject: Re: 3.2 cpplib: Permit directives in macro args
On Tue, 26 Feb 2002, Neil Booth wrote:
> Yeah, I forgot to ask about that. The thing is, it's not a constraint
> violation, which is my understanding of what -pedantic is for. At
> least, there are plenty of undefined things we don't pedwarn about.
>
> Maybe extra warnings or -Wunportable is more appropriate.
pedwarns if pedantic are fine for compile-time undefined behavior as well
as explicit constraint violations. -pedantic is what GCC uses for
portability testing, and how preprocessor conditionals inside strcmp (say)
should be detected if they make their way into GCC, rather than requiring
yet another option - in general -pedantic should give warnings for use of
extensions.
If you want to warn about this extension at -W, then you shouldn't have it
at all - the extension should only be present if it can be justified as
useful. I suspect the particular case of #undef of a macro while
expanding it is especially unlikely to be useful and disallowing would be
better than defining semantics for it.
--
Joseph S. Myers
jsm28@cam.ac.uk