This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: linux-2.5 min()/max() macros generate warnings with gcc-3.0.4and gcc-3.2
- From: "Joseph S. Myers" <jsm28 at cam dot ac dot uk>
- To: Thibaut VARENE <varenet at parisc-linux dot org>
- Cc: <gcc at gnu dot org>
- Date: Sat, 9 Nov 2002 23:13:31 +0000 (GMT)
- Subject: Re: linux-2.5 min()/max() macros generate warnings with gcc-3.0.4and gcc-3.2
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