[cfe-dev] -Wmissing-field-initializers

Sean McBride sean at rogue-research.com
Mon Feb 20 12:40:04 PST 2012

On Mon, 20 Feb 2012 12:16:36 -0800, John McCall said:

>-Wmissing-field-initializers does have a special case for intentional
>uses of the language's default-zero-initialization rules.  However, that
>special case is spelled {}, not {0}.  If you feel that this is a really
>common idiom for zero-initialization, we could also add it, but I'd
>really prefer not to, because it neuters -Wmissing-field-initializers on
>an interesting class of bugs.

But using {}, as you suggest, gives:

warning: use of GNU empty initializer extension [-pedantic,-Wgnu]

One seems trapped between one warning or the other.

Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada

More information about the cfe-dev mailing list