This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information
- From: "chengniansun at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Feb 2014 22:22:27 +0000
- Subject: [Bug c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60350
Bug ID: 60350
Summary: Incorrect -Wmaybe-uninitialized warning with incorrect
location information
Product: gcc
Version: 4.9.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: chengniansun at gmail dot com
Two questions regarding the following case
1) the variables "pf" and "pv" are uninitialized, but not maybe-uninitialized.
I am not sure whether this is the design choice of gcc.
2) The column numbers of the two warnings point to the same location ":", which
is not right.
$: cat s.c
void a(int i) {
int (*pf)[2];
int (*pv)[i + 1];
(i ? pf : pv);
}
$: gcc-trunk -Wuninitialized -c s.c
s.c: In function âaâ:
s.c:4:11: warning: âpfâ may be used uninitialized in this function
[-Wmaybe-uninitialized]
(i ? pf : pv);
^
s.c:4:11: warning: âpvâ may be used uninitialized in this function
[-Wmaybe-uninitialized]
$: gcc-trunk --version
gcc-trunk (GCC) 4.9.0 20140226 (experimental)
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.