[Bug middle-end/72826] Poor diagnostic for uninitialized structure field
zackw at panix dot com
gcc-bugzilla@gcc.gnu.org
Sat Aug 6 21:23:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=72826
--- Comment #2 from Zack Weinberg <zackw at panix dot com> ---
I can persuade it to print instead
test2.cc:6:9: warning: ‘timer.countdownTimer::started’ is used
uninitialized in this function [-Wuninitialized]
by using -O1 instead of -O2 or by removing the line `started = true;` I
suspect that -O1 turns off ESRA and removing the write makes it not replace the
variable.
While we're here, it is also misidentifying the function where the problem is:
test2.cc: In function ‘int main()’:
That should be "In function ‘countdownTimer::countdownTimer’". I presume the
problem here is inlining.
More information about the Gcc-bugs
mailing list