Clang Project

clang_source_code/test/Analysis/nullability.c
1// RUN: %clang_analyze_cc1 -fblocks -analyzer-checker=core,nullability -verify %s
2
3void it_takes_two(int a, int b);
4void function_pointer_arity_mismatch() {
5  void(*fptr)() = it_takes_two;
6  fptr(1); // no-crash expected-warning {{Function taking 2 arguments is called with fewer (1)}}
7}
8
9void block_arity_mismatch() {
10  void(^b)() = ^(int a, int b) { };
11  b(1);  // no-crash expected-warning {{Block taking 2 arguments is called with fewer (1)}}
12}
13