[PATCH] D63856: [ObjC] Add a -Wtautological-compare warning for BOOL

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 26 22:35:56 PDT 2019


rjmccall added a comment.

This only applies to relational operators, right?  I'm a little uncomfortable with calling this "tautological" since it's not like it's *undefined behavior* to have `(BOOL) 2`, it's just *unwise*.  But as long as we aren't warning about reasonable idioms that are intended to handle unfortunate situations — like other code that might have left a non-`{0,1}` value in the `BOOL` — I think this is fine.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63856/new/

https://reviews.llvm.org/D63856





More information about the cfe-commits mailing list