New warnings work, improvements to default warning behavior

I have been working on several patches to improve Clang warnings. The changes touch warnings that are in the default warning set or in common build configurations. I am posting these patches so interested people can test the warning behavior before they committed. In my testing, these warnings have caught many interesting and hard to find bugs already.

I’ve combined all the patches into one for easy testing:

Individual patches, spread out: - New precedence warning for mixing bitwise and/or with conditional operator - -Wtautological-overlap-compare to work on negative numbers - Better detection of same value operands for tautological warnings - New warning -Wtautological-bitwise-compare to check for non-zero value bitwise-or in bool context

These are improvements to -Wparentheses, -Wtautological-compare, and -Wtautological-overlap-compare with new warning -Wtautological-bitwise-compare.

Thanks for the heads-up!

akhuang gave the combined patch a try on Chromium. The improved warnings found two bugs and had no false positives :slight_smile:

( has the details.)

Thanks for testing out the warnings. Always nice to get more data on how well they are working.