[Bug middle-end/69578] -Wuninitialized not issuing warning.
selinger at mathstat dot dal.ca
gcc-bugzilla@gcc.gnu.org
Mon Sep 10 00:55:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69578
Peter Selinger <selinger at mathstat dot dal.ca> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |selinger at mathstat dot dal.ca
--- Comment #4 from Peter Selinger <selinger at mathstat dot dal.ca> ---
I ran into the same bug with this code:
double weight() {
double sum;
int i;
for (i=0; i<10; i++) {
sum++;
}
return sum;
}
With -Wuninitialized or -Wmaybe-uninitialized, no warning is generated with
-O0. The warning is generated with -O1, -O2, -O3. Other compilers (such as
clang) generate the warning correctly.
Confirmed with gcc 8.2.0.
More information about the Gcc-bugs
mailing list