diff --git a/tests/usr.bin/xlint/lint1/msg_185.c b/tests/usr.bin/xlint/lint1/msg_185.c index 2b72ce2e38c1..52496b4ffc53 100644 --- a/tests/usr.bin/xlint/lint1/msg_185.c +++ b/tests/usr.bin/xlint/lint1/msg_185.c @@ -1,7 +1,19 @@ -/* $NetBSD: msg_185.c,v 1.3 2021/02/22 15:09:50 rillig Exp $ */ +/* $NetBSD: msg_185.c,v 1.4 2021/03/18 21:20:21 rillig Exp $ */ # 3 "msg_185.c" // Test for message: initialization type mismatch (%s) and (%s) [185] -TODO: "Add example code that triggers the above message." /* expect: 249 */ -TODO: "Add example code that almost triggers the above message." +typedef struct any { + const void *value; +} any; + +void use(const void *); + +void +initialization_with_redundant_braces(any arg) +{ + any local = { 3.0 }; /* expect: 185 */ + use(&arg); +} + +// TODO: message 185 needs to be reworded to "cannot initialize '%s' from '%s'". diff --git a/tests/usr.bin/xlint/lint1/msg_185.exp b/tests/usr.bin/xlint/lint1/msg_185.exp index 9e9dfd51cf39..7db471a03461 100644 --- a/tests/usr.bin/xlint/lint1/msg_185.exp +++ b/tests/usr.bin/xlint/lint1/msg_185.exp @@ -1 +1 @@ -msg_185.c(6): syntax error ':' [249] +msg_185.c(15): initialization type mismatch (pointer to const void) and (double) [185]