[Bug c/60791] New: missing warning about uninitialized local variable

dominik.muth at gmx dot de gcc-bugzilla@gcc.gnu.org
Wed Apr 9 09:16:00 GMT 2014


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60791

            Bug ID: 60791
           Summary: missing warning about uninitialized local variable
           Product: gcc
           Version: 4.8.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dominik.muth at gmx dot de

// When compiling this file with
//
// -O3 -Wall -c
//
// There is no warning about the uninitialized use of r.

int f(int i) {
        int r;
        while (r != 0) {
                r = 0;
                i++;
        }
        return i;
}

// This is true for 4.6.3 and 4.8.2. However 2.95.2 does issue the warning.
//
// Leaving out optimization none of the above mentioned versions produces the
// warning (similar to 54554).



More information about the Gcc-bugs mailing list