Module Name: src Committed By: rillig Date: Sun Jan 24 17:55:41 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_225.c msg_225.exp Log Message: lint: add test for message 325, undefined static function To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/msg_225.c \ src/tests/usr.bin/xlint/lint1/msg_225.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_225.c diff -u src/tests/usr.bin/xlint/lint1/msg_225.c:1.1 src/tests/usr.bin/xlint/lint1/msg_225.c:1.2 --- src/tests/usr.bin/xlint/lint1/msg_225.c:1.1 Sat Jan 2 10:22:44 2021 +++ src/tests/usr.bin/xlint/lint1/msg_225.c Sun Jan 24 17:55:41 2021 @@ -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) +{ +} Index: src/tests/usr.bin/xlint/lint1/msg_225.exp diff -u src/tests/usr.bin/xlint/lint1/msg_225.exp:1.1 src/tests/usr.bin/xlint/lint1/msg_225.exp:1.2 --- src/tests/usr.bin/xlint/lint1/msg_225.exp:1.1 Sat Jan 2 10:22:44 2021 +++ src/tests/usr.bin/xlint/lint1/msg_225.exp Sun Jan 24 17:55:41 2021 @@ -1 +1 @@ -msg_225.c(6): syntax error ':' [249] +msg_225.c(13): static function called but not defined: undefined() [225]