Module Name:    src
Committed By:   rillig
Date:           Sat Apr 16 09:20:01 UTC 2022

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_084.c msg_084.exp

Log Message:
tests/lint: refine test for varargs function


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_084.c \
    src/tests/usr.bin/xlint/lint1/msg_084.exp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/tests/usr.bin/xlint/lint1/msg_084.c
diff -u src/tests/usr.bin/xlint/lint1/msg_084.c:1.3 src/tests/usr.bin/xlint/lint1/msg_084.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_084.c:1.3	Sun Jan 31 11:12:07 2021
+++ src/tests/usr.bin/xlint/lint1/msg_084.c	Sat Apr 16 09:20:01 2022
@@ -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] */
 
-void only_ellipsis(...)		/* expect: 84 */
+/* lint1-flags: -sw */
+
+/* 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];
 }
Index: src/tests/usr.bin/xlint/lint1/msg_084.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_084.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_084.exp:1.4
--- src/tests/usr.bin/xlint/lint1/msg_084.exp:1.3	Fri Apr  9 20:12:01 2021
+++ src/tests/usr.bin/xlint/lint1/msg_084.exp	Sat Apr 16 09:20:01 2022
@@ -1,2 +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]

Reply via email to