r373743 - [NFCI] Improve the -Wbool-operation's warning message

Arthur O'Dwyer via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 7 08:22:00 PDT 2019


On Mon, Oct 7, 2019 at 10:59 AM Dávid Bolvanský via cfe-commits <
cfe-commits at lists.llvm.org> wrote:

> Okey, I will see what I can do (I know I need to move checking code
> somewhere else).
>
> > Dňa 7. 10. 2019 o 16:54 užívateľ Nico Weber <thakis at chromium.org>
> napísal:
> > FWIW I found the "always evaluates to 'true'" bit important to
> understand the warning.
>

+1, I think "always evaluates to true" is useful, especially for people who
don't immediately intuit the difference between "bitwise negation" and
"logical negation." (Although the fixit will help clear up the difference.)

Also, Dávid, you misspelled "logical" as "logicial" in the patch I saw. So
you might need to push a fix for that typo, unless you already caught it.
My suggested message follows—

-  "bitwise negation of a boolean expression; did you mean a logicial
negation?">,
+  "bitwise negation of a boolean expression is always true; did you mean
logical negation?">,

my $.02,
–Arthur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191007/0d10e830/attachment.html>


More information about the cfe-commits mailing list