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/30575] Missing warning about unitialized variable



------- Comment #1 from muntyan at tamu dot edu  2007-01-25 13:27 -------
The original code warns if you use -O3 (I guess because of inlining or
something), the code below is better:

-------------------------
#include <stdio.h>

int func (void);

int main (void)
{
    int foo;

    if (func ())
        foo = 8;

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


-- 


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


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