This is the mail archive of the gcc@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: linux-2.5 min()/max() macros generate warnings with gcc-3.0.4andgcc-3.2


On Sun, 10 Nov 2002, Matthew Wilcox wrote:

> But... this is behaviour which changed between gcc 2.96 and 3.0.
> Seems to me the "gnu89" definition has been retroactively changed to
> disallow this feature.  And I don't understand why you wouldn't want
> this feature to be part of gnu89 anyway.  Can you elucidate?

That would be a bug in 2.9x that it failed to detect this case.  Where a
typedef is used (with const in the typedefed type and explicitly), the
warning in 2.95 is mandatory and in 3.2 is properly conditioned on the
standard version selected.  The warning is generally easy to avoid - even
in the presence of macros, as here (the const in the macro is unnecessary)  
and this is not documented as a GCC extension, nor I think did 2.9x
document accepting the typeof case.  If a new warning it might well be
only if -pedantic, but I'm not aware of any pre-C99 user requests for this
as an extension and for a long time there was just the mandatory warning.

-- 
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]