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: demonstrate missing ch...
details: https://anonhg.NetBSD.org/src/rev/9f479f7c4ef0
branches: trunk
changeset: 365784:9f479f7c4ef0
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Apr 24 19:46:29 2022 +0000
description:
tests/lint: demonstrate missing check for missing type
diffstat:
tests/usr.bin/xlint/lint1/msg_001.c | 24 ++++++++++++++++++++++--
tests/usr.bin/xlint/lint1/msg_001.exp | 6 +++++-
2 files changed, 27 insertions(+), 3 deletions(-)
diffs (44 lines):
diff -r e5ab632c7050 -r 9f479f7c4ef0 tests/usr.bin/xlint/lint1/msg_001.c
--- a/tests/usr.bin/xlint/lint1/msg_001.c Sun Apr 24 19:21:01 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_001.c Sun Apr 24 19:46:29 2022 +0000
@@ -1,8 +1,28 @@
-/* $NetBSD: msg_001.c,v 1.4 2021/01/31 11:23:01 rillig Exp $ */
+/* $NetBSD: msg_001.c,v 1.5 2022/04/24 19:46:29 rillig Exp $ */
# 3 "msg_001.c"
// Test for message: old style declaration; add 'int' [1]
-old_style = 1; /* expect: [1] */
+/* expect+1: warning: old style declaration; add 'int' [1] */
+old_style = 1;
int new_style = 1;
+
+/* expect+2: error: old style declaration; add 'int' [1] */
+/* expect+1: warning: static variable static_old_style unused [226] */
+static static_old_style = 1;
+
+/* expect+1: warning: static variable static_new_style unused [226] */
+static int static_new_style = 1;
+
+/* TODO: complain about missing 'int' */
+extern_implicit_int(void)
+{
+}
+
+/* TODO: complain about missing 'int' */
+/* expect+2: warning: static function static_implicit_int unused [236] */
+static
+static_implicit_int(void)
+{
+}
diff -r e5ab632c7050 -r 9f479f7c4ef0 tests/usr.bin/xlint/lint1/msg_001.exp
--- a/tests/usr.bin/xlint/lint1/msg_001.exp Sun Apr 24 19:21:01 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_001.exp Sun Apr 24 19:46:29 2022 +0000
@@ -1,1 +1,5 @@
-msg_001.c(6): warning: old style declaration; add 'int' [1]
+msg_001.c(7): warning: old style declaration; add 'int' [1]
+msg_001.c(13): error: old style declaration; add 'int' [1]
+msg_001.c(13): warning: static variable static_old_style unused [226]
+msg_001.c(16): warning: static variable static_new_style unused [226]
+msg_001.c(26): warning: static function static_implicit_int unused [236]
Home |
Main Index |
Thread Index |
Old Index