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

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

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

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