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 lint: add test for message 325, un...



details:   https://anonhg.NetBSD.org/src/rev/1bbd5e9f22a0
branches:  trunk
changeset: 950317:1bbd5e9f22a0
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 24 17:55:41 2021 +0000

description:
lint: add test for message 325, undefined static function

diffstat:

 tests/usr.bin/xlint/lint1/msg_225.c   |  19 ++++++++++++++++---
 tests/usr.bin/xlint/lint1/msg_225.exp |   2 +-
 2 files changed, 17 insertions(+), 4 deletions(-)

diffs (33 lines):

diff -r edbb7793866c -r 1bbd5e9f22a0 tests/usr.bin/xlint/lint1/msg_225.c
--- a/tests/usr.bin/xlint/lint1/msg_225.c       Sun Jan 24 17:44:37 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_225.c       Sun Jan 24 17:55:41 2021 +0000
@@ -1,7 +1,20 @@
-/*     $NetBSD: msg_225.c,v 1.1 2021/01/02 10:22:44 rillig Exp $       */
+/*     $NetBSD: msg_225.c,v 1.2 2021/01/24 17:55:41 rillig Exp $       */
 # 3 "msg_225.c"
 
 // Test for message: static function called but not defined: %s() [225]
 
-TODO: "Add example code that triggers the above message."
-TODO: "Add example code that almost triggers the above message."
+static void undefined(void);
+
+static void defined_later(void);
+
+void
+caller(void)
+{
+       undefined();            /* expect: 225 */
+       defined_later();
+}
+
+static void
+defined_later(void)
+{
+}
diff -r edbb7793866c -r 1bbd5e9f22a0 tests/usr.bin/xlint/lint1/msg_225.exp
--- a/tests/usr.bin/xlint/lint1/msg_225.exp     Sun Jan 24 17:44:37 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_225.exp     Sun Jan 24 17:55:41 2021 +0000
@@ -1,1 +1,1 @@
-msg_225.c(6): syntax error ':' [249]
+msg_225.c(13): static function called but not defined: undefined() [225]



Home | Main Index | Thread Index | Old Index