[PATCH] D33825: [clang-tidy] signal handler must be plain old function check

2020-08-29 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 288777. bruntib added a comment. Note texts are now describing what kind of C++ constructs were used. The warning message also explains better the reason of the issue: "signal handlers must be plain old functions, C++-only constructs are not allowed" Repos

[PATCH] D33825: [clang-tidy] signal handler must be plain old function check

2020-08-29 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added inline comments. Comment at: clang-tools-extra/test/clang-tidy/checkers/cert-signal-handler-must-be-plain-old-function.cpp:22 + // CHECK-MESSAGES: :[[@LINE-1]]:17: warning: do not use C++ constructs in signal handlers [cert-msc54-cpp] + // CHECK-MESSAGES: :[[@LI

[PATCH] D33825: [clang-tidy] signal handler must be plain old function check

2020-08-29 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 288774. bruntib added a comment. Test file has been extended with the second line of the "note" diagnostic message which designates the location of the suspicious "C++ construct". The full clang-tidy output looks like this: llvm-project/clang-tools-extra/te

[PATCH] D33825: [clang-tidy] signal handler must be plain old function check

2020-08-28 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 288617. bruntib added a comment. Update lincense. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D33825/new/ https://reviews.llvm.org/D33825 Files: clang-tools-extra/clang-tidy/cert/CERTTidyModule.cpp clang-t

[PATCH] D33825: [clang-tidy] signal handler must be plain old function check

2020-08-28 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 288606. bruntib added a comment. Herald added a subscriber: mgehre. I rebased the patch so it compiles with master version of LLVM/Clang. I did no other change, so I would like if this patch would be committed on behalf of @NorenaLeonetti if the patch is acc

[PATCH] D33825: [clang-tidy] signal handler must be plain old function check

2020-08-28 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib commandeered this revision. bruntib added a reviewer: NorenaLeonetti. bruntib added a comment. Herald added subscribers: martong, steakhal, jfb. I'll rebase this patch and continue its development. Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D33825/new/ h

[PATCH] D80210: [analyzer] Turn off reports in system headers

2020-06-24 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added a comment. Hi, Thanks everyone for the investigation in this problem. I find these suggestions reasonable, and I think this commented example is a strong beating card in our hands to convince our users that paths going through system headers are meaningful and important. I'll star

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 219097. bruntib added a comment. Usually I'm not a big fan of `auto`, but in this case it makes sense not to duplicate the type name in the same expression. I'll use this rule of thumb in the future, thanks :) Repository: rCTE Clang Tools Extra CHANGES

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 219088. bruntib edited the summary of this revision. bruntib added a comment. Thank you for the suggestion. I didn't know about this behavior of `%check_clang_tidy`. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D67265: [clang-tidy] Magic number checker shouldn't warn on user defined string literals

2019-09-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: alexfh, Szelethus, 0x8000-, aaron.ballman. Herald added subscribers: cfe-commits, xazax.hun, whisperity. Herald added a project: clang. The following code snippet results a false positive report in the magic number checker: std::string

[PATCH] D66333: [analyzer] NonNullParamChecker and CStringChecker parameter number in checker message

2019-08-17 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib marked 3 inline comments as done. bruntib added inline comments. Comment at: clang/lib/StaticAnalyzer/Checkers/CStringChecker.cpp:202 + SVal l, + unsigned idx = -1u) const; ProgramStateRef CheckLocatio

[PATCH] D66333: [analyzer] NonNullParamChecker and CStringChecker parameter number in checker message

2019-08-17 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 215754. bruntib added a comment. The checker message has been changed according to the suggestion. The last parameter of checkNonNull() doesn't require a default or optional value, so it has been fixed. The parameter has been renamed from Idx to IdxOfArg. R

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-08-16 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added a comment. Thank you for the valuable comments and the review! I'm just planning to register to the bug tracker, because it is getting more relevant due to some other contributions as well. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/

[PATCH] D66333: NonNullParamChecker and CStringChecker parameter number in checker message

2019-08-16 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: alexfh, NoQ, Szelethus, xazax.hun. Herald added subscribers: cfe-commits, rnkovacs. Herald added a project: clang. There are some functions which can't be given a null pointer as parameter either because it has a nonnull attribute or it is d

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-08-14 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 215122. bruntib added a comment. Since now the order of diagnostic messages is deterministic, we can count on this order in the test file. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65065/new/ https://review

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-08-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added a comment. This suggestion would result another strange behavior: if the user disables cert-err09-cpp because he or she doesn't want to see its reports, the other one (cert-err61-cpp) will still report the issue. So he or she has to disable both (or as many aliases it has). As fa

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-08-06 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added a comment. Not exactly. The problem is that it is non-deterministic which checker reports the issue. For example before this patch, in the test file above there was only one report. However, sometimes the report message is: throw expression should throw anonymous temporary values

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-08-05 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added a comment. Alright, I modified the commit accordingly. Thank you for the suggestions. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65065/new/ https://reviews.llvm.org/D65065 ___ cfe-commi

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-08-05 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 213356. bruntib edited the summary of this revision. Repository: rCTE Clang Tools Extra CHANGES SINCE LAST ACTION https://reviews.llvm.org/D65065/new/ https://reviews.llvm.org/D65065 Files: clang-tools-extra/clang-tidy/ClangTidyDiagnosticConsumer.cpp

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-07-23 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added a comment. Yes, LessClangTidyError would really be the best place for this. The reason of my implementation was that I wanted to bind this feature to a command line option. I don't know if there was any design decision behind the current uniquing logic and I didn't want to break i

[PATCH] D65065: [clang-tidy] Possibility of displaying duplicate warnings

2019-07-22 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: alexfh, xazax.hun, Szelethus. Herald added subscribers: cfe-commits, mgrang, rnkovacs, whisperity. Herald added a project: clang. In case a checker is registered multiple times as an alias, the emitted warnings are uniqued by the report mess

[PATCH] D57893: [analyzer] Fix function macro crash

2019-03-14 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 190575. bruntib added a comment. I've uploaded another version of the last fix. The previous one contained an UB, although it worked practically. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57893/new/ https://reviews.llvm.

[PATCH] D57893: [analyzer] Fix function macro crash

2019-03-13 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 190485. bruntib added a comment. I added a condition before std::next() invocations to check if the next element is inside the valid interval. This fixes the crash of the build-bot. Sorry for the ugly bug. I don't know if there is a more elegant solution.

[PATCH] D57893: [analyzer] Fix function macro crash

2019-03-12 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 190225. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57893/new/ https://reviews.llvm.org/D57893 Files: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plis

[PATCH] D57893: [analyzer] Fix function macro crash

2019-03-12 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib added a comment. I rebased the patch on the current master. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57893/new/ https://reviews.llvm.org/D57893 ___ cfe-commits mailing list cfe-commits@lists.llvm.org htt

[PATCH] D57891: [analyzer] Fix infinite recursion in printing macros

2019-03-07 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 189670. bruntib added a comment. Herald added subscribers: Charusso, jdoerfert, whisperity. I added a test case for this recursive case. There is also a TODO in the code indicating the place where an additional fix will be required. Repository: rC Clang

[PATCH] D57893: [analyzer] Fix function macro crash

2019-02-10 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 186161. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57893/new/ https://reviews.llvm.org/D57893 Files: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp test/Analysis/Inputs/expected-plists/plist-macros-with-expansion.cpp.plist test/Analysis/plist-

[PATCH] D57893: [analyzer] Fix function macro crash

2019-02-08 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 185971. bruntib added a comment. There was another place where this crash could have happened. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57893/new/ https://reviews.llvm.org/D57893 Files: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp test/Ana

[PATCH] D57893: [analyzer] Fix function macro crash

2019-02-08 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib updated this revision to Diff 185957. bruntib added a comment. I've added a test case. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57893/new/ https://reviews.llvm.org/D57893 Files: lib/StaticAnalyzer/Core/PlistDiagnostics.cpp test/Analysis/Inputs/expected-plists/plist-mac

[PATCH] D57893: [analyzer] Fix function macro crash

2019-02-07 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: NoQ, george.karpenkov, Szelethus, xazax.hun. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. Herald added a project: clang. When there is a functor-like macro which

[PATCH] D57892: [analyzer] Fix macro printer crash when macro comes from another translation unit

2019-02-07 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: NoQ, george.karpenkov, Szelethus, xazax.hun. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. Herald added a project: clang. Repository: rC Clang https://reviews.

[PATCH] D57891: [analyzer] Fix infinite recursion in printing macros

2019-02-07 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: NoQ, george.karpenkov, Szelethus, xazax.hun. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet, baloghadamsoftware. Herald added a project: clang. #define f(y) x #define x f(x) int main()

[PATCH] D57890: [analyzer] Fix in self assignment checker

2019-02-07 Thread Tibor Brunner via Phabricator via cfe-commits
bruntib created this revision. bruntib added reviewers: NoQ, george.karpenkov, Szelethus, xazax.hun, baloghadamsoftware. Herald added subscribers: cfe-commits, dkrupp, donat.nagy, mikhail.ramalho, a.sidorin, rnkovacs, szepet. Herald added a project: clang. For self assignment checker it was nece