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: clean up test for misp...



details:   https://anonhg.NetBSD.org/src/rev/72097b027017
branches:  trunk
changeset: 1023396:72097b027017
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Sep 05 18:39:58 2021 +0000

description:
tests/lint: clean up test for misplaced lint comments

A varargs comment that appears in the function body is already covered
by varargs_bad_body.  Cleaning up this test makes sure that the warning
is indeed triggered by the comment in the parameters declaration.

diffstat:

 tests/usr.bin/xlint/lint1/msg_280.c   |   4 +---
 tests/usr.bin/xlint/lint1/msg_280.exp |  13 ++++++-------
 2 files changed, 7 insertions(+), 10 deletions(-)

diffs (35 lines):

diff -r 74693cbec3f2 -r 72097b027017 tests/usr.bin/xlint/lint1/msg_280.c
--- a/tests/usr.bin/xlint/lint1/msg_280.c       Sun Sep 05 18:34:50 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_280.c       Sun Sep 05 18:39:58 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_280.c,v 1.3 2021/08/30 19:48:21 rillig Exp $       */
+/*     $NetBSD: msg_280.c,v 1.4 2021/09/05 18:39:58 rillig Exp $       */
 # 3 "msg_280.c"
 
 // Test for message: must be outside function: /* %s */ [280]
@@ -14,8 +14,6 @@
 /* XXX: Why is this comment considered 'outside' enough? */
 varargs_bad_param(/* VARARGS */ const char *str, ...)
 {
-       /* expect+1: warning: must be outside function: */
-       /* VARARGS */
        (void)str;
 }
 
diff -r 74693cbec3f2 -r 72097b027017 tests/usr.bin/xlint/lint1/msg_280.exp
--- a/tests/usr.bin/xlint/lint1/msg_280.exp     Sun Sep 05 18:34:50 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_280.exp     Sun Sep 05 18:39:58 2021 +0000
@@ -1,7 +1,6 @@
-msg_280.c(18): warning: must be outside function: /* VARARGS */ [280]
-msg_280.c(24): warning: must be outside function: /* VARARGS */ [280]
-msg_280.c(34): warning: must be outside function: /* VARARGS */ [280]
-msg_280.c(43): warning: must be outside function: /* ARGSUSED */ [280]
-msg_280.c(40): warning: argument 'str' unused in function 'argsused_bad_body' [231]
-msg_280.c(50): warning: must be outside function: /* PRINTFLIKE */ [280]
-msg_280.c(58): warning: must be outside function: /* SCANFLIKE */ [280]
+msg_280.c(22): warning: must be outside function: /* VARARGS */ [280]
+msg_280.c(32): warning: must be outside function: /* VARARGS */ [280]
+msg_280.c(41): warning: must be outside function: /* ARGSUSED */ [280]
+msg_280.c(38): warning: argument 'str' unused in function 'argsused_bad_body' [231]
+msg_280.c(48): warning: must be outside function: /* PRINTFLIKE */ [280]
+msg_280.c(56): warning: must be outside function: /* SCANFLIKE */ [280]



Home | Main Index | Thread Index | Old Index