[Bug fortran/50923] [4.4/4.5/4.6/4.7 Regression] No warning if function return value is not set
rguenth at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Sat Nov 5 12:11:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=50923
Richard Guenther <rguenth at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Last reconfirmed| |2011-11-05
Ever Confirmed|0 |1
--- Comment #1 from Richard Guenther <rguenth at gcc dot gnu.org> 2011-11-05 12:11:18 UTC ---
The fortran frontend emits
f ()
{
}
in this the middle-end does not warn because TREE_NO_WARNING is set
on the function decl by the frontend:
if (result == NULL_TREE)
{
/* TODO: move to the appropriate place in resolve.c. */
if (warn_return_type && !sym->attr.referenced && sym == sym->result)
gfc_warning ("Return value of function '%s' at %L not set",
sym->name, &sym->declared_at);
TREE_NO_WARNING(sym->backend_decl) = 1;
More information about the Gcc-bugs
mailing list