------- Comment #4 from lloyd at randombit dot net  2007-05-10 17:51 -------
Manuel,

For your example code, GCC _is_ aware that the function always returns, since
the code it generates for it (with optimization) is:

f:
        movl    %edi, %eax
        ret

So obviously it knows, at the level of the code generator, it's just a question
of propagating that information back to the frontend.

Speaking of the same warnings with-or-without optimizations - should I then
file a bug about:

int f(int x)
{
    int y;
    if(x)
        return y;
    return 0;
}

No warning about y being used uninitialized unless I compile with
optimizations...


-- 


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

Reply via email to