aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/flex-array-sizeof.c
blob: 05394e19a6b27529f7456ac2ceaa1bf9a7425726 (plain)
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
 */