[Bug c/81851] missing -Wduplicated-branches on if and return statements with no else
redi at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Thu Jul 19 20:22:00 GMT 2018
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81851
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Should it warn here?
int g (int i)
{
if (i == 0) // no warning
return 0;
#if SOME_OTHER_PLATFORM
if (i == 2)
return 1;
#endif
return 0;
}
When not compiling for SOME_OTHER_PLATFORM this ends up being equivalent to
your original g, do you want this to warn?
More information about the Gcc-bugs
mailing list