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

--- Comment #12 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Only in your reading of the documentation.

You clearly don't know what you are asking for, even the very common case of
pthread_t th;
if (pthread_create (&th, NULL, tf, NULL))
  goto fail;
pthread_join (th, NULL);
case would need to be warned about, even when there is nothing wrong about it.
In your testcase, if fn1 isn't inlined, it is the same thing for GCC, a
function call as a black box which could do anything to the memory pointed to
by the escaped pointer (unless the function is say pure or const, at which
point it couldn't store to it).  If it is inlined, the compiler sees it, sees
that a variable is used and in certain path has uninitialized value and in
others initialized, and correctly warns.

Reply via email to