[PATCH] clang-tidy checker that enforce proper parentheses in macros

Daniel Marjamäki daniel.marjamaki at evidente.se
Mon Jun 8 06:54:57 PDT 2015


I have copied the isOneOf from FormatToken. I did not want to move TokenType etc and therefore the FormatToken still has isOneOf also. As far as I see all comments in the code has been taken care of.

I've rerun original and latest patch with my script and compared warnings. This time duplicated warnings was filtered out.

Original patch:
projects: 217
warnings: 3758

Latest patch:
projects: 100
warnings: 2529

The "193 projects" I initially talked about should be a subset of the projects I checked today.. unless some project has been removed from the debian archive I'm checking last month.

Latest patch gives more warnings than the original patch. The original checker stopped the checking of a macro when a problem was found. Now all violations in the macro are reported (and fixed).

Also when comparing warnings from the original patch and latest patch there are some warnings that are not reported with latest patch. I don't see false negatives, only fixed false positives.


http://reviews.llvm.org/D9528

Files:
  include/clang/Lex/Token.h
  tools/extra/clang-tidy/misc/CMakeLists.txt
  tools/extra/clang-tidy/misc/MacroParenthesesCheck.cpp
  tools/extra/clang-tidy/misc/MacroParenthesesCheck.h
  tools/extra/clang-tidy/misc/MiscTidyModule.cpp
  tools/extra/test/clang-tidy/misc-macro-parentheses.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9528.27309.patch
Type: text/x-patch
Size: 12579 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150608/de1c82da/attachment.bin>


More information about the cfe-commits mailing list