38 lines · c
1 2// Currently the check is performed for apple targets only.3void test(const char *path) {4 int fd = open(path, O_CREAT);5 // warn: call to 'open' requires a third argument when the6 // 'O_CREAT' flag is set7}8 9void f();10 11void test() {12 pthread_once_t pred = {0x30B1BCBA, {0}};13 pthread_once(&pred, f);14 // warn: call to 'pthread_once' uses the local variable15}16 17void test() {18 void *p = malloc(0); // warn: allocation size of 0 bytes19}20 21void test() {22 void *p = calloc(0, 42); // warn: allocation size of 0 bytes23}24 25void test() {26 void *p = malloc(1);27 p = realloc(p, 0); // warn: allocation size of 0 bytes28}29 30void test() {31 void *p = alloca(0); // warn: allocation size of 0 bytes32}33 34void test() {35 void *p = valloc(0); // warn: allocation size of 0 bytes36}37 38