public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* braces warning in DJGPP
@ 1999-12-05 15:12 Blackbear
  1999-12-06  6:04 ` Blackbear
  1999-12-31 22:24 ` Blackbear
  0 siblings, 2 replies; 6+ messages in thread
From: Blackbear @ 1999-12-05 15:12 UTC (permalink / raw)
  To: help-gcc

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: 

<quote>
   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 };

</quote>

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


--

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~1999-12-31 22:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-05 15:12 braces warning in DJGPP Blackbear
1999-12-06  6:04 ` Blackbear
1999-12-11 17:28   ` passing options through g++/gcc to linker Dave Topham
1999-12-31 22:24     ` Dave Topham
1999-12-31 22:24   ` braces warning in DJGPP Blackbear
1999-12-31 22:24 ` Blackbear

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).