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]
Other format: [Raw text]

[Bug c/45468] gcc does not warn about missing `-O' flag when specifying `-Wuninitialized'



------- Comment #14 from jellegeerts at gmail dot com  2010-08-31 21:16 -------
(In reply to comment #13)
> (In reply to comment #12)
> > @Manuel,
> > So, perhaps then this bug report is at least sort of valid? It seems that to
> > get `-Wuninitialized' to *fully* work, one would need at least `-O1'?
> 
> No, higher levels of optimization may provide even better warnings (or disable
> some false positives)

Aye, I thought about that, but I didn't know enough about GCC and opted for
making the question a bit simpler. I realize now that I shouldn't have, as this
kind of sloppiness might spread misinformation. Sorry.

> There is no such thing as a *fully* working Wuninitialized. The results totally
> depend on which optimization passes are run (and their order). See
> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings for more background on
> the issues involved and existing bugs.

:( It is an unfortunate truth that GCC's warnings are sometimes far from
optimal, but maybe it's also good in some ways. For one thing, it forces us
programmers to be more conscientious while coding.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45468


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