bolt/deps/llvm-18.1.8/clang-tools-extra/test/clang-tidy/checkers/concurrency/mt-unsafe-glibc.cpp

16 lines
519 B
C++
Raw Normal View History

2025-02-14 19:21:04 +01:00
// RUN: %check_clang_tidy %s concurrency-mt-unsafe %t -- -config='{CheckOptions: {concurrency-mt-unsafe.FunctionSet: "glibc"}}'
extern unsigned int sleep (unsigned int __seconds);
extern int *gmtime (const int *__timer);
extern char *dirname (char *__path);
void foo() {
sleep(2);
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: function is not thread safe [concurrency-mt-unsafe]
::sleep(2);
// CHECK-MESSAGES: :[[@LINE-1]]:3: warning: function is not thread safe [concurrency-mt-unsafe]
dirname(nullptr);
}