http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55288
Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2012-11-12
CC| |manu at gcc dot gnu.org
Ever Confirmed|0 |1
--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> 2012-11-12
20:07:31 UTC ---
Why don't just initialize the variable? It seems simpler than implementing yet
another special attribute in GCC.
That said, I find strange that the warning points to somewhere within a
function without telling the user where from that function was called. For more
complex testcases, this could turn out to be very confusing. Also, the location
is not actually pointing to the variable but to ';'.
Clang says:
pr55288.cc:40:9: warning: variable 'q' may be uninitialized when used here
[-Wconditional-uninitialized]
foo(q);
^
pr55288.cc:22:8: note: initialize the variable 'q' to silence this warning
int q;
^
= 0