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: refine test for vararg...



details:   https://anonhg.NetBSD.org/src/rev/cdb88a7b672e
branches:  trunk
changeset: 365245:cdb88a7b672e
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Apr 16 09:20:01 2022 +0000

description:
tests/lint: refine test for varargs function

diffstat:

 tests/usr.bin/xlint/lint1/msg_084.c   |  14 ++++++++++----
 tests/usr.bin/xlint/lint1/msg_084.exp |   3 +--
 2 files changed, 11 insertions(+), 6 deletions(-)

diffs (33 lines):

diff -r 1abbcc3ff628 -r cdb88a7b672e tests/usr.bin/xlint/lint1/msg_084.c
--- a/tests/usr.bin/xlint/lint1/msg_084.c       Sat Apr 16 09:18:33 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_084.c       Sat Apr 16 09:20:01 2022 +0000
@@ -1,12 +1,18 @@
-/*     $NetBSD: msg_084.c,v 1.3 2021/01/31 11:12:07 rillig Exp $       */
+/*     $NetBSD: msg_084.c,v 1.4 2022/04/16 09:20:01 rillig Exp $       */
 # 3 "msg_084.c"
 
-// Test for message: ANSI C requires formal parameter before '...' [84]
+/* Test for message: ANSI C requires formal parameter before '...' [84] */
+
+/* lint1-flags: -sw */
 
-void only_ellipsis(...)                /* expect: 84 */
+/* expect+2: error: ANSI C requires formal parameter before '...' [84] */
+void
+only_ellipsis(...)
 {
 }
 
-void ok_ellipsis(const char *fmt, ...) /* expect: 231 */
+char
+ok_ellipsis(const char *fmt, ...)
 {
+       return fmt[0];
 }
diff -r 1abbcc3ff628 -r cdb88a7b672e tests/usr.bin/xlint/lint1/msg_084.exp
--- a/tests/usr.bin/xlint/lint1/msg_084.exp     Sat Apr 16 09:18:33 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_084.exp     Sat Apr 16 09:20:01 2022 +0000
@@ -1,2 +1,1 @@
-msg_084.c(6): warning: ANSI C requires formal parameter before '...' [84]
-msg_084.c(10): warning: argument 'fmt' unused in function 'ok_ellipsis' [231]
+msg_084.c(10): error: ANSI C requires formal parameter before '...' [84]



Home | Main Index | Thread Index | Old Index