Patch -Wtraditional, warn about `U' integer constant suffix

Kaveh R. Ghazi
Tue Aug 8 07:59:00 GMT 2000

 > From: Zack Weinberg <>
 > __extension__ isn't appropriate and would require modifying the system
 > headers.

I agree __extension__ isn't appropriate, but for a different reason.
It elides *pedantic* warnings not the regular kind.  I was kicking
around the idea of adding a __nowarn__ keyword which would do the
analogous thing for regular warnings.  Or __nowarn__ (<parameter>) so
one could elide specific types, e.g. __traditional__,
__sign_compare__, etc.

I disagree it would require modifying system headers.  I.e. you
wouldn't stick __extension__ (or __nowarn__) into the limits.h
definition of UINT_MAX.  Instead, you would add the keyword at the
point of usage in your own code, if it triggered a harmless warning.

 > In theory, you could preserve information about where each macro
 > definition came from.  For all macros defined in system headers,
 > toggle system-header-ness on and off when you step in and out of the
 > expansion.  This may be possible right now for warnings generated by
 > the preprocessor.  The compiler doesn't have access to that level of
 > detail - the integrated preprocessor mode *could* do it, but you'd
 > have to augment the interface.  All in all, more work than I have time
 > for right now.
 > zw

How hard would it be just to do the standalone preprocessor part for
warnings generated by cpp?  We could leave the integreated
preprocessor mode for later.

Kaveh R. Ghazi			Engagement Manager / Project Services		Qwest Internet Solutions

More information about the Gcc-patches mailing list