aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/bool-array.c
blob: 6c4c872349231834d34f00463a60fbedba0340ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
static _Bool boolarray_d1[1];
static _Bool boolarray_d8[8];
static _Bool boolarray_i2[2] = {
	0,
	1,
};
static int nd1 = sizeof(boolarray_d1);
static int nd8 = sizeof(boolarray_d8);
static int ni2 = sizeof(boolarray_i2);


static long longarray_u2[] = {
	0,
	1,
};
static int nl2 = sizeof(longarray_u2);

/*
 * Used to get "warning: excessive elements in array initializer"
 * for all elements but the first one.
 * Note: only occurs if nbr of elements is a multiple of 8
 *       (if not, theer was another problem)
 */
static _Bool boolarray_u8[] = {
	0,
	1,
	0,
	1,
	0,
	1,
	0,
	1,
};

/*
 * Used to get "error: cannot size expression" for the sizeof.
 */
static _Bool boolarray_u2[] = {
	0,
	1,
};
static int nu2 = sizeof(boolarray_u2);

/*
 * check-name: sizeof(bool array)
 * check-command: sparse -Wno-sizeof-bool $file
 */