[Bug c/12153] New: uninitialized use not spotted in "T x = x;"

simon dot marshall at misys dot com gcc-bugzilla@gcc.gnu.org
Wed Sep 3 13:50:00 GMT 2003


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

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

           Summary: uninitialized use not spotted in "T x = x;"
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: simon dot marshall at misys dot com
                CC: gcc-bugs at gcc dot gnu dot org

With the program:

#include <stdio.h>
int main ()
{
    int x = x;
    printf ("x=%d\n", x);
    return 0;
}

gcc -O -W -Wall does not report the use of x before initialisation (as it would 
at the printf() if it had been "int x;").

Obscure I know, but we had a C++ code typo of this form which gcc should have 
spotted.



More information about the Gcc-bugs mailing list