xref: /netbsd-src/tests/usr.bin/xlint/lint1/msg_174.c (revision 7d62b00eb9ad855ffcd7da46b41e23feb5476fac)
1 /*	$NetBSD: msg_174.c,v 1.5 2022/06/16 16:58:36 rillig Exp $	*/
2 # 3 "msg_174.c"
3 
4 // Test for message: too many initializers [174]
5 
6 void
7 example(void)
8 {
9 	/* A single pair of braces is always allowed. */
10 	int n = { 13 };
11 
12 	/* expect+1: error: too many initializers [174] */
13 	int too_many = { 17, 19 };
14 
15 	/*
16 	 * An initializer list must have at least one expression, says the
17 	 * syntax definition in C99 6.7.8.
18 	 */
19 	int too_few = {};
20 }
21