[PATCH] D19497: [clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.

Etienne Bergeron via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 25 14:22:52 PDT 2016


etienneb created this revision.
etienneb added a reviewer: alexfh.
etienneb added a subscriber: cfe-commits.

The checker was noisy when running over llvm code base.
This patch is impriving the way string-compare functions are matched.

1) By default, do not report !strcmp(...) unless it's activate by the user,
2) Only match suspicious expression over a subset of expression (binary operator),
3) Added matching of macro wrapper used with clang on linux.

See bug: 27465.

http://reviews.llvm.org/D19497

Files:
  clang-tidy/misc/SuspiciousStringCompareCheck.cpp
  test/clang-tidy/misc-suspicious-string-compare.c
  test/clang-tidy/misc-suspicious-string-compare.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19497.54908.patch
Type: text/x-patch
Size: 9148 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160425/26d7bb01/attachment.bin>


More information about the cfe-commits mailing list