Dubious "'foo' might be used uninitialized in this function" message

Nathan Sidwell nathan@codesourcery.com
Tue Dec 14 17:00:00 GMT 2004


Dmitry Antipov wrote:

> w.c: In function `f':
> w.c:5: warning: 'z' might be used uninitialized in this function
> 
> which is not true.
'tis true too, just here.
    return x + y + z;

read the documentation for -Wuninitialized, which will explain
why it can't get all the cases correct.

> Is it reasonable to learn GCC do more analysis in attempt to avoid
> warning in this case ? How is it complex ?

it gets as complex as the halting problem :)

nathan

-- 
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk



More information about the Gcc mailing list