[Bug c/30575] New: Missing warning about unitialized variable

muntyan at tamu dot edu gcc-bugzilla@gcc.gnu.org
Wed Jan 24 14:37:00 GMT 2007


The following code doesn't produce a warning when compiled with gcc-4.1.2.
gcc-3.4 does warn about it.

#include <stdio.h>

int func (void)
{
    return 0;
}

int main (void)
{
    int foo;

    if (func ())
        foo = 8;

    printf ("%d\n", foo);
    return 0;
}


-- 
           Summary: Missing warning about unitialized variable
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: muntyan at tamu dot edu


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



More information about the Gcc-bugs mailing list