------- Comment #5 from manu at gcc dot gnu dot org  2007-05-11 11:38 -------
(In reply to comment #4)
> So obviously it knows, at the level of the code generator, it's just a 
> question
> of propagating that information back to the frontend.

I wrote: "yes, as far as GCC knows when it emits the warning, f() may return
without a value". So obviously, code generation happens way after the warning
is emitted. There is no "propagating back information to the front-end". Sorry.
This is not how GCC works. So, yes, fixing this may require rewriting GCC. But
even if it were trivial, that is, even if when using optimisation we could
detect that no warning is needed, there is the current policy of giving (in
general) the same warnings with and without optimisation. Thus, GCC may still
decide to give a warning.

So I still don't think this is worthy to be called a bug, at best it is
WONTFIX. But, hey!, if you want to keep it open in case some brave volunteer
developer appears from the void and decides to contribute some magical patch...
who knows, the hero might be you. ;-)

> Speaking of the same warnings with-or-without optimizations - should I then
> file a bug about:
[snip]
> No warning about y being used uninitialized unless I compile with
> optimizations...

Currently, -Wuninitialized needs optimisation to do any work. This may change
in the future, though. You chose one of the few exceptions to illustrate your
point. 


-- 


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

Reply via email to