aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/validation/eval/union-cast.c
blob: 1d8167531081377f2a078dea56a741f17baca764 (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
union u {
	int	i;
	char	x[8];
};

static union u foo(int a)
{
	return (union u)a;
}

static union u bar(long a)
{
	return (union u)a;
}

/*
 * check-name: union-cast
 * check-command: sparse -Wunion-cast $file
 * check-known-to-fail
 *
 * check-error-start
eval/union-cast.c:8:17: warning: cast to union type
eval/union-cast.c:13:17: warning: cast to non-scalar
 * check-error-end
 */