1 #define is_constexpr(x) \
2 (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
6 unsigned int s
= 0, i
= 0;
18 s
+= is_constexpr(ptr
++);
19 s
+= is_constexpr((i
++, 1));
20 s
+= is_constexpr(sizeof *ptr
);
21 s
+= is_constexpr(ptr
+ 1);
22 s
+= is_constexpr(&ptr
+ 1);
23 s
+= is_constexpr(*(((char *)&ptr
) + 1));
29 * check-name: sizeof(void) is valid
30 * check-description: sizeof(void) was rejected because void is an incomplete
32 * check-command: sparse -Wpointer-arith $file
35 sizeof-void.c:16:14: warning: expression using sizeof(void)
36 sizeof-void.c:17:14: warning: expression using sizeof(void)
37 sizeof-void.c:18:14: warning: expression using sizeof(void)
38 sizeof-void.c:19:14: warning: expression using sizeof(void)
39 sizeof-void.c:20:14: warning: expression using sizeof(void)
40 sizeof-void.c:21:14: warning: expression using sizeof(void)
41 sizeof-void.c:22:14: warning: expression using sizeof(void)
42 sizeof-void.c:23:14: warning: expression using sizeof(void)