1 static int *a = (int*)0; // OK
2 static int b = 0;
3 static int *c = (int*)b; // KO
4
5
6 /*
7 * check-name: integer literal cast to pointer type constness verification.
8 * check-command: sparse -Wconstexpr-not-const $file
9 *
10 * check-error-start
11 constexpr-pointer-cast.c:3:18: warning: non-constant initializer for static object
12 * check-error-end
13 */
|
1 static int *a = (int*)0; // OK
2 static int b = 0;
3 static int *c = (int*)b; // KO
4
5
6 /*
7 * check-name: constexprness integer literal cast to pointer type
8 * check-command: sparse -Wconstexpr-not-const $file
9 *
10 * check-error-start
11 constexpr-pointer-cast.c:3:18: warning: non-constant initializer for static object
12 * check-error-end
13 */
|