On 10/03/2016 11:09 AM, Bernd Edlinger wrote:
Hi!
This is a next step in extending the -Wint-in-bool-context warning
to cover the case when a conditional expression has only
one arm which evaluates to a non-boolean integer value.
With a previous version of this warning, we found PR 77574,
among with several more or less false positives, but meanwhile,
mostly due to excluding conditional expressions that originate
from macro expansion, there are no false positives any more,
so I think this is fine now with -Wall.
Bootstrapped and reg-tested on x86_64-pc-linux-gnu.
Is it OK for trunk?
Thanks
Bernd.
patch-bool-context2.diff
c-family:
2016-10-03 Bernd Edlinger <bernd.edlin...@hotmail.de>
* c-common.c (c_common_truthvalue_conversion): Warn also for suspicious
conditional expression in boolean context when only one arm is
non-boolean.
testsuite:
2016-10-03 Bernd Edlinger <bernd.edlin...@hotmail.de>
* c-c++-common/Wint-in-bool-context.c: Update test.
OK.
jeff