Debian Codegraph @

clang-tools-extra/test/clang-tidy/checkers/android/cloexec-inotify-init.cpp

raw
1 // RUN: %check_clang_tidy %s android-cloexec-inotify-init %t
2
3 extern "C" int inotify_init();
4
5 void f() {
6 inotify_init();
7 // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: prefer inotify_init() to inotify_init1() because inotify_init1() allows IN_CLOEXEC [android-cloexec-inotify-init]
8 // CHECK-FIXES: inotify_init1(IN_CLOEXEC);
9 }
10
11 namespace i {
12 int inotify_init();
13 void g() {
14 inotify_init();
15 }
16 } // namespace i
17
18 class C {
19 public:
20 int inotify_init();
21 void h() {
22 inotify_init();
23 }
24 };