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

Erik Pilkington via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jun 26 17:28:14 PDT 2019


erik.pilkington created this revision.
erik.pilkington added reviewers: rjmccall, steven_wu, rsmith.
Herald added subscribers: dexonsmith, jkorous.
Herald added a project: clang.

On macOS, BOOL is a typedef for signed char, but it should never hold a value that isn't 1 or 0. Any code that expects a different value in their BOOL should be fixed.

rdar://problem/51954400 ObjC: Add diagnostics to catch incorrect usage of BOOL


Repository:
  rC Clang

https://reviews.llvm.org/D63856

Files:
  clang/include/clang/Basic/DiagnosticGroups.td
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Sema/SemaChecking.cpp
  clang/test/Sema/tautological-objc-bool-compare.m

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D63856.206773.patch
Type: text/x-patch
Size: 6133 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190627/acaa6efb/attachment.bin>


More information about the cfe-commits mailing list