Module Name: src Committed By: rillig Date: Sun Apr 24 19:46:29 UTC 2022
Modified Files: src/tests/usr.bin/xlint/lint1: msg_001.c msg_001.exp Log Message: tests/lint: demonstrate missing check for missing type To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_001.c cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_001.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_001.c diff -u src/tests/usr.bin/xlint/lint1/msg_001.c:1.4 src/tests/usr.bin/xlint/lint1/msg_001.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_001.c:1.4 Sun Jan 31 11:23:01 2021 +++ src/tests/usr.bin/xlint/lint1/msg_001.c Sun Apr 24 19:46:29 2022 @@ -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) +{ +} Index: src/tests/usr.bin/xlint/lint1/msg_001.exp diff -u src/tests/usr.bin/xlint/lint1/msg_001.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_001.exp:1.4 --- src/tests/usr.bin/xlint/lint1/msg_001.exp:1.3 Sun Jan 31 11:23:01 2021 +++ src/tests/usr.bin/xlint/lint1/msg_001.exp Sun Apr 24 19:46:29 2022 @@ -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]