egcs1.1.1 bogus warning: "might be used uninitialized"

Jeffrey A Law law@hurl.cygnus.com
Wed Feb 10 12:23:00 GMT 1999


  In message < 19990210195309.9533.qmail@piglet.chem-eng.nwu.edu >you write:
  > I too got this warning, which mysteriously went away after I changed
  > unrelated things.  In my case, the warning referred to a function in
  > g++/std/bastring.h (I think).  Sounds like a hard bug to track down...
GCC's code for generating the "uninitialized" warning isn't as good as it
could be and therefore it can generate false positives.

One of the optimizations we added in egcs-1.1 (gcse/pre) tends to rearrange
code in a manner which confuses the code which generates this warning and we
end up with more false positives that we got with the egcs-1.0 era compilers.

Now, changing code in one function should not be changing the warnings gcc
emits for an unrelated function *unless* the function changed is actually
a template or is inlined.  If neither of those cases are true, then there's
a serious bug that needs to be addressed.

Finally, I'll note that there will always be cases where you can get false
"uninitialized" warnings.  Fixing all of them requires solving the halting
problem :-)


More information about the Gcc-bugs mailing list