[clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.
authorEtienne Bergeron <etienneb@google.com>
Tue, 26 Apr 2016 16:53:21 +0000 (16:53 +0000)
committerEtienne Bergeron <etienneb@google.com>
Tue, 26 Apr 2016 16:53:21 +0000 (16:53 +0000)
commit1b94f6504b37df09244e5fe8c0507559823edc48
tree9d34d322277f279190ac2de5e3ff7da196569ac0
parentdbcf5b99d03a278e681e3bd5632d69751f8ce9d1
[clang-tidy] Enhance misc-suspicious-string-compare to move down false-positives.

Summary:
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.

Reviewers: alexfh

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D19497

llvm-svn: 267570
clang-tools-extra/clang-tidy/misc/SuspiciousStringCompareCheck.cpp
clang-tools-extra/test/clang-tidy/misc-suspicious-string-compare.c
clang-tools-extra/test/clang-tidy/misc-suspicious-string-compare.cpp