brintos

brintos / llvm-project-archived public Read only

0
0
Text · 687 B · e592b57 Raw
21 lines · c
1// RUN: %check_clang_tidy %s bugprone-command-processor %t2 3typedef struct FILE {} FILE;4 5extern int system(const char *);6extern FILE *popen(const char *, const char *);7extern FILE *_popen(const char *, const char *);8 9void f(void) {10  // It is permissible to check for the presence of a command processor.11  system(0);12 13  system("test");14  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling 'system' uses a command processor [bugprone-command-processor]15 16  popen("test", "test");17  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling 'popen' uses a command processor18  _popen("test", "test");19  // CHECK-MESSAGES: :[[@LINE-1]]:3: warning: calling '_popen' uses a command processor20}21