summaryrefslogtreecommitdiff
path: root/tests/usr.bin/xlint/lint1/d_compound_literals2.c
blob: 2e11f4cb48b9d14a3d7914cfaba3c72b8b1fb580 (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
/*	$NetBSD: d_compound_literals2.c,v 1.5 2023/03/28 14:44:34 rillig Exp $	*/
# 3 "d_compound_literals2.c"

/* compound literals */

/* lint1-extra-flags: -X 351 */

struct p {
	short a, b, c, d;
} zz = {
	1, 2, 3, 4
};

struct p *
bar(int i)
{
	static struct p q[10];
	return &q[i];
}

void foo(void)
{
	*bar(1) = (struct p){ 1, 2, 3, 4 };
}