https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105348
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Blocks| |56456 --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- We are generally diagnosing conditional code. Consider changing your example to put the if (cond(l)) conditional in g(), guarding the call to f(). Then the code in f() would look "unconditional" but of course in reality little code as reachable from program entry is "unconditional", so artificially treating some conditionals as "more conditional" than others is not the solution. So the bottom line is that it's hard to avoid diagnosing such cases and it's not even desirable. The solution is to avoid putting too much abstraction into the guarding conditional. Referenced Bugs: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56456 [Bug 56456] [meta-bug] bogus/missing -Warray-bounds