1static int a = 1; 2static int b[2] = {1, 1}; 3 4static int *c = &b[1]; // OK 5static int *d = (int*)0 + 1; // OK 6static int *e = &b[1] + 1; // OK 7static int *f = b + 1; // OK 8static int *g = d + 1; // KO 9static int *h = &a + 1; // OK 10static int *i = &b[1] + 1; // OK 11static int *j = b + 1; // OK 12static int *k = d + 1; // KO 13static int *l = &*&b[1]; // OK 14static int *m = &*(&a + 1); // OK 15static int *n = &*(&b[1] + 1); // OK 16static int *o = &*(b + 1); // OK 17static int *p = &*(d + 1); // KO 18 19/* 20 * check-name: consrexprness pointer arithmetic 21 * check-command: sparse -Wconstexpr-not-const $file 22 * 23 * check-error-start 24constexpr-pointer-arith.c:8:19: warning: non-constant initializer for static object 25constexpr-pointer-arith.c:12:19: warning: non-constant initializer for static object 26constexpr-pointer-arith.c:17:22: warning: non-constant initializer for static object 27 * check-error-end 28 */ 29