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

source code of clang-tools-extra/test/clang-tidy/checkers/concurrency/mt-unsafe-glibc.cpp