[PATCH] D66046: Add new tautological compare warning for bitwise-or with a non-zero constant

Nico Weber via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 21 14:51:01 PDT 2019


thakis added inline comments.


================
Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8161
+  "bitwise or with non-zero value always evaluates to true">,
+  InGroup<TautologicalBitwiseCompare>, DefaultIgnore;
 def warn_tautological_overlap_comparison : Warning<
----------------
rtrieu wrote:
> jfb wrote:
> > rtrieu wrote:
> > > jfb wrote:
> > > > Why default ignore?
> > > This warning, like the tautological overlap warning, uses the CFG.  CFG-based analysis are typically excluded from being default warnings due to the extra work of construction the CFG.
> > Can you say so in the commit message?
> Updated patch description.
It addresses why it's not on-by-default, but not why it's not in -Wall. As I said 2 comments ago, we've kind of retconned -Wall to mean "needs CFG" at times.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D66046





More information about the cfe-commits mailing list