Removing uninitialized_var()
Removing uninitialized_var()
Posted Dec 20, 2012 15:03 UTC (Thu) by nix (subscriber, #2304)In reply to: Removing uninitialized_var() by mjthayer
Parent article: Removing uninitialized_var()
It can, of course, never be right in all circumstances (that would require a solution to the halting problem). It can sometimes be sure, and says as much ('is used uninitialized'). Often, it's not sure. What's odious is that there are lots of apparently simple cases that GCC can't yet handle, e.g.
if (foo)
/* initialize a */
/* later */
if (foo) /* value not affected by code above */
/* use a */
is a particularly notorious case.
