[PATCH] fix warning about duplicate 'const'

Joseph S. Myers jsm@polyomino.org.uk
Wed Mar 10 10:15:00 GMT 2004


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



More information about the Gcc mailing list