aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/constexpr-pointer-cast.c
blob: bdf668c1ac60cd7f96c9dd22ec70c6531b36cb75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
static int *a = (int*)0;	// OK
static int b = 0;
static int *c = (int*)b;	// KO


/*
 * check-name: constexprness integer literal cast to pointer type
 * check-command: sparse -Wconstexpr-not-const $file
 *
 * check-error-start
constexpr-pointer-cast.c:3:18: warning: non-constant initializer for static object
 * check-error-end
 */