1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
struct s { int i; long f[]; }; static int foo(struct s *s) { return sizeof(*s); } /* * check-name: flex-array-sizeof * check-command: sparse -Wflexible-array-sizeof $file * * check-error-start flex-array-sizeof.c:8:16: warning: using sizeof on a flexible structure * check-error-end */