linux-2.5 min()/max() macros generate warnings with gcc-3.0.4 and gcc-3.2

Joseph S. Myers jsm28@cam.ac.uk
Sat Nov 9 15:33:00 GMT 2002


On Sun, 10 Nov 2002, Thibaut VARENE wrote:

> But, according to C99, section 6.7.3 "Type qualifiers", paragraph 4,
> "if the same qualifier appears more than once in the same
> specifier-qualifier-list, [...] the behavior is the same as if it
> appeared only once."
> 
> So gcc shouldn't be complaining...

The warning is appropriately conditioned on whether you're in C99 mode.  
If you use -std=c99 or -std=gnu99 you won't get the warning (but Linux
uses at least one feature only permitted in gnu89 mode, treating compound
literals as values that can be used in static initializers rather than
references to anonymous variables which is the C99 notion).

-- 
Joseph S. Myers
jsm28@cam.ac.uk



More information about the Gcc mailing list