This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PR c/13282: Add a separate -Wmissing-field-initializer


On Thu, 29 Jul 2004, Richard Sandiford wrote:

> One of the warnings enabled by -Wextra is for struct initialisers that
> have fewer fields than the struct itself.  PR c/13282 asks for a separate
> switch to control the warning, much like we already have with -Wsign-compare.
> 
> Bootstrapped & regression tested on i686-pc-linux-gnu.  OK to install?

This patch doesn't test (or document, though that's a pre-existing
condition) the useful property that (at least for C) the use of designated
initializers disables the warning for a particular set of braces.

        /* Do not warn if this level of the initializer uses member
           designators; it is likely to be deliberate.  */

-- 
Joseph S. Myers               http://www.srcf.ucam.org/~jsm28/gcc/
    jsm@polyomino.org.uk (personal mail)
    jsm28@gcc.gnu.org (Bugzilla assignments and CCs)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]