1 /* $NetBSD: msg_174.c,v 1.7 2024/05/09 20:53:13 rillig Exp $ */
2 # 3 "msg_174.c"
3
4 // Test for message: too many initializers for '%s' [174]
5
6 /* lint1-extra-flags: -X 351 */
7
8 void
example(void)9 example(void)
10 {
11 /* A single pair of braces is always allowed. */
12 int n = { 13 };
13
14 /* expect+1: error: too many initializers for 'int' [174] */
15 int too_many = { 17, 19 };
16
17 /*
18 * An initializer list must have at least one expression, says the
19 * syntax definition in C99 6.7.8.
20 */
21 int too_few = {};
22 }
23