4 ms·
This is not possible. void foo(int x) { if (x) do_something(); else do_something_else(); } void fn1() { foo(0); } void fn2() { foo(
by ogoffart 7y ago
This is not possible.
void foo(int x) {
if (x) do_something();
else do_something_else();
}
void fn1() { foo(0); }
void fn2() { foo(1); }
When the code is inlined, the compiler can propagate constant and optimize the `if`. Do you really expect two warnings there?
These warning would happen all the time.
And anyway, this does not apply to this particular bug which is just a compiler bug (which has been fixed). The warning was there all along:
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.