This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/64823] New: [5.0 Regression] false "may be used uninitialized"
- From: "alserkli at inbox dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 27 Jan 2015 17:45:44 +0000
- Subject: [Bug c/64823] New: [5.0 Regression] false "may be used uninitialized"
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64823
Bug ID: 64823
Summary: [5.0 Regression] false "may be used uninitialized"
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
Assignee: unassigned at gcc dot gnu.org
Reporter: alserkli at inbox dot ru
Compilation of (GDB) 7.9.50.20150127-cvs with (GCC) 5.0.0 20150127 fails due to
false warning (gdb is compiled with -Werror). It was not a problem in GCC
4.7.2.
// a.c: simplified from the expansion of ALL_OBJSECTIONS in
gdb/gdb/symfile.c:unmap_overlay_command
struct os { struct o *o; };
struct o { struct o *next; struct os *se; };
void f(struct o *o){
struct os *s;
if(o) s = o->se;
while(o && s == o->se){
s++; // here `o' is non-zero and thus s is initialized
s == o->se // `?' is essential, `if' does not trigger the warning
? (o = o->next, o ? s = o->se : 0)
: 0;
}
}
$ gcc -O2 -Wall -Werror -c a.c
a.c: In function âfâ:
a.c:8:6: error: âsâ may be used uninitialized in this function
[-Werror=maybe-uninitialized]
s++; // here `o' is non-zero and thus s is initialized
^
cc1: all warnings being treated as errors