This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized
- From: "lacombar at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 26 Jul 2011 01:29:38 +0000
- Subject: [Bug c/49848] New: False positive warning triggered by -Wmaybe-uninitialized
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49848
Summary: False positive warning triggered by
-Wmaybe-uninitialized
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned@gcc.gnu.org
ReportedBy: lacombar@gmail.com
Considering the attached reduced-testcase, gcc will trigger the following
warning:
% gcc -m32 -Wall -Os -c -S -o /dev/null foo.c
foo.c: In function 'foo':
foo.c:9:12: warning: 'b' may be used uninitialized in this function
Affected gcc is:
% gcc -v
Using built-in specs.
[...]
Thread model: posix
gcc version 4.5.1 20100924 (Red Hat 4.5.1-4) (GCC)
however, gcc from trunk (as of 20110609) also produces the warning:
/src/x86-64/obj/destdir/bin/x86_64-none-linux-gcc -m32 -Wall -Os -c -S -o
/dev/null foo.c
foo.c: In function 'foo':
foo.c:14:21: warning: 'b' may be used uninitialized in this function
[-Wmaybe-uninitialized]
This warning only shows up at -Os.
Mailing list reference: http://gcc.gnu.org/ml/gcc-help/2011-07/msg00243.html