File tree 2 files changed +13
-1
lines changed
2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,8 @@ static Preprocessor *PP;
30
30
31
31
void BadSignalToKillThreadCheck::check (const MatchFinder::MatchResult &Result) {
32
32
const auto IsSigterm = [](const auto &KeyValue) -> bool {
33
- return KeyValue.first ->getName () == " SIGTERM" ;
33
+ return KeyValue.first ->getName () == " SIGTERM" &&
34
+ KeyValue.first ->hasMacroDefinition ();
34
35
};
35
36
const auto TryExpandAsInteger =
36
37
[](Preprocessor::macro_iterator It) -> Optional<unsigned > {
Original file line number Diff line number Diff line change
1
+ // RUN: clang-tidy %s --checks=-*,bugprone-bad-signal-to-kill-thread -- | count 0
2
+
3
+ #define SIGTERM 15
4
+ #undef SIGTERM // no-crash
5
+ using pthread_t = int ;
6
+ int pthread_kill (pthread_t thread, int sig);
7
+
8
+ int func () {
9
+ pthread_t thread;
10
+ return pthread_kill (thread, 0 );
11
+ }
You can’t perform that action at this time.
0 commit comments