This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug middle-end/72826] Poor diagnostic for uninitialized structure field
- From: "zackw at panix dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sat, 06 Aug 2016 21:22:55 +0000
- Subject: [Bug middle-end/72826] Poor diagnostic for uninitialized structure field
- Auto-submitted: auto-generated
- References: <bug-72826-4@http.gcc.gnu.org/bugzilla/>
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.