This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] fix warning about duplicate 'const'
- From: "Joseph S. Myers" <jsm at polyomino dot org dot uk>
- To: Neil Booth <neil at daikokuya dot co dot uk>
- Cc: Linus Torvalds <torvalds at osdl dot org>, Thomas Schlichter <thomas dot schlichter at web dot de>, Andrew Morton <akpm at osdl dot org>, linux-kernel at vger dot kernel dot org, gcc at gcc dot gnu dot org
- Date: Wed, 10 Mar 2004 10:15:44 +0000 (UTC)
- Subject: Re: [PATCH] fix warning about duplicate 'const'
- References: <200403090043.21043.thomas.schlichter@web.de><20040308161410.49127bdf.akpm@osdl.org> <Pine.LNX.4.58.0403081627450.9575@ppc970.osdl.org><200403090217.40867.thomas.schlichter@web.de> <Pine.LNX.4.58.0403081728250.9575@ppc970.osdl.org><20040310054918.GB4068@twiddle.net> <20040310064001.GA7584@daikokuya.co.uk>
On Wed, 10 Mar 2004, Neil Booth wrote:
> > seems dicey at best. I'm not sure what to do about this, actually.
> > We might could do something with a new __nonqual_typeof(a) that
> > strips outermost type qualifications, but I havn't given that much
> > thought.
>
> Or you could compile in C99 mode?
The gnu89-only kludge allowing compound literals in static initializers in
certain cases, for compatibility with their old ill-defined semantics, is
there because it was needed by Linux; I don't know if it's still needed,
but that would prevent compiling in C99 mode where compound literals have
only their C99 semantics as unnamed variables.
Simpler to restrict the pedwarns for duplicate qualifiers to (pedantic &&
!flag_isoc99) (in all the various cases warned for) and document this as
an extension from C99 that is accepted in C89/C90 mode.
--
Joseph S. Myers
jsm@polyomino.org.uk