From mboxrd@z Thu Jan 1 00:00:00 1970 From: therapy@ripco.com (Blackbear) To: help-gcc@gnu.org Subject: braces warning in DJGPP Date: Fri, 31 Dec 1999 22:24:00 -0000 Message-ID: <82er4c$b06$1@gail.ripco.com> X-SW-Source: 1999-12n/msg00070.html Message-ID: <19991231222400.4MAv-9t_m97oEtko-_rH7CjTnAXH2R46cw31M82Nth4@z> Hello everyone. I like to compile using the `-Wall' flag so that the compiler can catch possible errors for me. For warnings that I don't want to see, I then put "-Wno-xxxxx" options after "-Wall" on the command line -- to turn off those warnings. But there is one warning that I can't disable. When I create a structure like so: struct decoder { int value; const char * name; }; static struct decoder basic_msgs [] = { 1, "first", 2, "second", 3, "third", . . . }; The compiler issues a warning: histbase.m:36: warning: missing braces around initializer histbase.m:36: warning: (near initialization for `basic_msgs[0]') The compiler wants me to place braces around each element in the array. I don't want to do that for this type of array since it's unnecessary. The info file for gcc says that the option `-W' enables this warning. This is what info says: The following `-W...' options are not implied by `-Wall'. Some of them warn about constructions that users generally do not consider questionable, but which occasionally you might wish to check for; others warn about constructions that are necessary or hard to avoid in some cases, and there is no simple way to modify the code to suppress the warning. `-W' Print extra warning messages for these events: [...] * An aggregate has a partly bracketed initializer. For example, the following code would evoke such a warning, because braces are missing around the initializer for `x.h': struct s { int f, g; }; struct t { struct s h; int i; }; struct t x = { 1, 2, 3 }; So INFO says that "-Wall" does not set this warning option. But in my experience it seems to. Also, "-W" by itself DOES NOT enable this warning, and so INFO seems to be wrong. "-Wno" is an invalid option. How do I disable this warning? I'm using the GCC 2.95.1 that is a part of DJGPP. Can anyone help me? Thanks in advance. therapy at ripco dot com --