This is the mail archive of the gcc@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]

invalid "may be used uninitialized" warning with g++ current


The following code

int bar(int *global)
{
    int local;
    if(&local != global)
        return 0;
    return local;
}

compiled with gcc/x86/Linux version 4.4.0 20090204 (experimental)
[trunk revision 143938]
trigger warning:

# g++ -Wall -O2 -c test4.cpp
test4.cpp: In function 'int bar(int*)':
test4.cpp:6: warning: 'local' may be used uninitialized in this function

gcc-3.4.6/FreeBSD/x86 and gcc-4.1.2/FedoraCore8/x86 does not warning.

I was tried to find anything similar in bugzilla (including #24639), but fail.

I miss something or I need to file bug report?

Dmitry


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