[Bug middle-end/60488] missing uninitialized warning (address taken, VOP)
msebor at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Feb 16 04:22:00 GMT 2017
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60488
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Known to fail| |4.8.3, 4.9.3, 5.3.0, 6.2.0,
| |7.0
--- Comment #4 from Martin Sebor <msebor at gcc dot gnu.org> ---
You're right that the goto isn't essential here. The same problem can be
demonstrated in the simplified test case below. When f(&a) && f(&b) evaluates
to true (and assuming f() initializes what it points to) there "exists a path
from the function entry to a use of the variable that is initialized." But
f(&a) evaluates to false f(&b) is not called then "there exists a path for
which b is not initialized." Since there is no way to prove that the second
path is not taken at runtime then, according to the documentation, GCC should
emit a warning. However, no warning is issued.
int f (int*);
int foo (void)
{
int a, b;
if (f (&a) && f (&b))
return 0;
return a + b;
}
More information about the Gcc-bugs
mailing list