db/fixup_kernel.sh: fix clear_user() handling
[smatch.git] / validation / flex-array-error.c
blob2b7e6953050c6868a8e30f3d47a6eff43e74dcdf
1 struct s {
2 int i;
3 long f[];
4 int j;
5 };
7 union u {
8 int i;
9 long f[];
12 // trigger the examination of the offending types
13 static int foo(struct s *s, union u *u)
15 return __builtin_offsetof(typeof(*s), i)
16 + __builtin_offsetof(typeof(*u), i);
20 * check-name: flex-array-error
22 * check-error-start
23 flex-array-error.c:3:14: error: flexible array member 'f' is not last
24 flex-array-error.c:9:14: error: flexible array member 'f' in a union
25 * check-error-end