This is the mail archive of the gcc-bugs@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]

Re: GCC 2.95.2 -- warning where there is no reason for one


>     // Although I have obviously exhausted all legitimate variants of
>     // enumerator "EMy e" in the switch, however I still get this

Thanks for your bug report. This is not a bug, but an implementation
limitation:

`-Wuninitialized'
     ...
     These warnings are made optional because GCC is not smart enough
     to see all the reasons why the code might be correct despite
     appearing to have an error.  Here is one example of how this can
     happen:

          {
            int x;
            switch (y)
              {
              case 1: x = 1;
                break;
              case 2: x = 4;
                break;
              case 3: x = 5;
              }
            foo (x);
          }

     If the value of `y' is always 1, 2 or 3, then `x' is always
     initialized, but GCC doesn't know this.

Regards,
Martin

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