blob: 006185b7a4e5f3c5d9a85506ffc6978ac8782ec0 (
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
|
/* $NetBSD: d_c99_union_cast.c,v 1.8 2023/07/07 19:45:22 rillig Exp $ */
# 3 "d_c99_union_cast.c"
/* C99 does not define union cast, it is a GCC extension. */
/* lint1-flags: -Sw -X 351 */
struct bar {
int a;
int b;
};
union foo {
struct bar *a;
int b;
};
void
foo(struct bar *a)
{
/* expect+1: error: union cast is a GCC extension [328] */
a = ((union foo)a).a;
/* expect+1: error: union cast is a GCC extension [328] */
a = ((union foo)"string");
a->a++;
}
|