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: egcs1.1.1 bogus warning: "might be used uninitialized"



  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 :-)


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