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?