aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/cond-address-array.c
blob: e1d2f87f8783d8c157db2a87ea4d1494aab209b3 (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
int foo(void) {
	extern int a[];

	if (a)
		return 1;
	return 0;
}

int bar(void) {
	int a[2];

	if (a)
		return 1;
	return 0;
}

/*
 * check-name: cond-address-array.c
 * check-command: test-linearize -Wno-decl -Waddress $file
 * check-output-ignore
 *
 * check-error-start
cond-address-array.c:4:13: warning: the address of an array will always evaluate as true
cond-address-array.c:12:13: warning: the address of an array will always evaluate as true
 * check-error-end
 */