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 c/60350] New: Incorrect -Wmaybe-uninitialized warning with incorrect location information


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.

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