This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/54554] Undetected use of uninitialized variable
- From: "dpapavas at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 04 Jan 2013 14:50:32 +0000
- Subject: [Bug c/54554] Undetected use of uninitialized variable
- Auto-submitted: auto-generated
- References: <bug-54554-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54554
--- Comment #6 from Dimitris Papavasiliou <dpapavas at gmail dot com> 2013-01-04 14:50:32 UTC ---
Well this seems to be a core decision regarding the way GCC warnings work
(which probably has more far-reaching consequences) but just for the sake of
argument, I don't see why people should complain even in such a case. The only
use I can think of for code such as the above is temporarily switching of a
statement but, apart from the fact that this can be more efficiently done with
preprocessor directives, the thing is that temporarily disabling a statement in
this way is meaningful if it is expected that it will be re-enabled at some
time in the future. If that would lead to broken code there's not much of a
point.
I don't mean to dictate the coding-style others should use of course but still
it seems to me like a small price to pay for avoiding obscure stochastic bugs
that can take hours of debugging to locate (especially given the fact that
there's good reason to disable optimizations when debugging code).