| 1 | // RUN: %check_clang_tidy %s concurrency-mt-unsafe %t -- -config='{CheckOptions: {concurrency-mt-unsafe.FunctionSet: "glibc"}}' |
| 2 | |
| 3 | extern unsigned int sleep (unsigned int __seconds); |
| 4 | extern int *gmtime (const int *__timer); |
| 5 | extern char *dirname (char *__path); |
| 6 | extern char *strerror(int errnum); |
| 7 | |
| 8 | void foo() { |
| 9 | sleep(seconds: 2); |
| 10 | // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: function is not thread safe [concurrency-mt-unsafe] |
| 11 | |
| 12 | ::sleep(seconds: 2); |
| 13 | // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: function is not thread safe [concurrency-mt-unsafe] |
| 14 | |
| 15 | dirname(path: nullptr); |
| 16 | |
| 17 | strerror(errnum: 0); |
| 18 | } |
| 19 | |