Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/tests/usr.bin/xlint/lint1 tests/lint: test initialization wi...



details:   https://anonhg.NetBSD.org/src/rev/7422109dc5bc
branches:  trunk
changeset: 960820:7422109dc5bc
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Mar 29 22:59:03 2021 +0000

description:
tests/lint: test initialization without braces

diffstat:

 tests/usr.bin/xlint/lint1/msg_181.c   |  6 +++---
 tests/usr.bin/xlint/lint1/msg_181.exp |  2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

diffs (20 lines):

diff -r 6b8e55956461 -r 7422109dc5bc tests/usr.bin/xlint/lint1/msg_181.c
--- a/tests/usr.bin/xlint/lint1/msg_181.c       Mon Mar 29 22:54:19 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_181.c       Mon Mar 29 22:59:03 2021 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_181.c,v 1.2 2021/02/21 09:07:58 rillig Exp $       */
+/*     $NetBSD: msg_181.c,v 1.3 2021/03/29 22:59:03 rillig Exp $       */
 # 3 "msg_181.c"
 
 // Test for message: {}-enclosed initializer required [181]
 
-TODO: "Add example code that triggers the above message." /* expect: 249 */
-TODO: "Add example code that almost triggers the above message."
+struct { int x; } missing_braces = 3;          /* expect: 181 */
+struct { int x; } including_braces = { 3 };
diff -r 6b8e55956461 -r 7422109dc5bc tests/usr.bin/xlint/lint1/msg_181.exp
--- a/tests/usr.bin/xlint/lint1/msg_181.exp     Mon Mar 29 22:54:19 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_181.exp     Mon Mar 29 22:59:03 2021 +0000
@@ -1,1 +1,1 @@
-msg_181.c(6): error: syntax error ':' [249]
+msg_181.c(6): error: {}-enclosed initializer required [181]



Home | Main Index | Thread Index | Old Index