• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 struct s {
2 	int i;
3 	long f[];
4 	int j;
5 };
6 
7 union u {
8 	int i;
9 	long f[];
10 };
11 
12 // trigger the examination of the offending types
foo(struct s * s,union u * u)13 static int foo(struct s *s, union u *u)
14 {
15 	return    __builtin_offsetof(typeof(*s), i)
16 		+ __builtin_offsetof(typeof(*u), i);
17 }
18 
19 /*
20  * check-name: flex-array-error
21  *
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
26  */
27