https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68336
Martin Sebor <msebor at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
Status|UNCONFIRMED |NEW
Last reconfirmed| |2015-11-13
CC| |msebor at gcc dot gnu.org
Ever confirmed|0 |1
--- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> ---
Confirmed. An even simpler test case is below. See also bug 67629.
$ cat z.c && /build/gcc-trunk-svn/gcc/xgcc -B /build/gcc-trunk-svn/gcc -S -Wall
-o/dev/null z.c
int f (void)
{
for (int i = 1; i; )
return 1;
}
z.c: In function âfâ:
z.c:5:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
G++ also warns on the trivial:
int f (void)
{
if (bool b = true)
return 1;
}