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/8a150e4daf40
branches:  trunk
changeset: 954132:8a150e4daf40
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 2cce93b66d3b -r 8a150e4daf40 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 2cce93b66d3b -r 8a150e4daf40 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