This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

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


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