aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/flex-array-padding.c
blob: 2ba77971266ee7cd282011bd0366e433b8538893 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
struct s {
	__INT32_TYPE__ x;
	__INT16_TYPE__ y;
	unsigned char f[];
};

static int foo(struct s *s)
{
	return __builtin_offsetof(typeof(*s), f);
}

/*
 * check-name: flex-array-padding
 * check-command: test-linearize -Wflexible-array-padding $file
 * check-known-to-fail
 *
 * check-output-ignore
 *
 * check-error-start
flex-array-padding.c:4:23: warning: flexible array member has padding
 * check-error-end
 */