This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug middle-end/72826] Poor diagnostic for uninitialized structure field


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]