JonasToth added a comment.

You noted, that the C++ warning would catch this case, but does not get 
triggered in C. Would it be wort to generalize the concern and have a warning 
that catch the comparison, regardless of the macro?

Do other major libraries define a similar macro but name it differently? If so, 
including there names would be worthwhile.



================
Comment at: clang-tidy/bugprone/ComparisonInTempFailureRetryCheck.cpp:22
+namespace {
+AST_MATCHER(Expr, isBinOpComparison) {
+  const auto *BinOp = dyn_cast<BinaryOperator>(Node.IgnoreParenCasts());
----------------
I think this matcher already exists.

https://github.com/JonasToth/clang-tools-extra/blob/master/clang-tidy/utils/Matchers.h

`isEqualityOperator` would work? See the other matchers there too. If the 
matchers there would not do it, maybe add one there.


https://reviews.llvm.org/D45059



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to