Module Name: src Committed By: rillig Date: Sun Jul 11 19:30:56 UTC 2021
Modified Files: src/tests/usr.bin/xlint/lint1: msg_023.c msg_023.exp msg_193.c msg_193.exp msg_194.exp msg_232.c msg_232.exp src/usr.bin/xlint/lint1: decl.c err.c Log Message: lint: add quotes around placeholders in message 23 and 232 To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_023.c \ src/tests/usr.bin/xlint/lint1/msg_023.exp \ src/tests/usr.bin/xlint/lint1/msg_194.exp cvs rdiff -u -r1.11 -r1.12 src/tests/usr.bin/xlint/lint1/msg_193.c \ src/tests/usr.bin/xlint/lint1/msg_193.exp cvs rdiff -u -r1.4 -r1.5 src/tests/usr.bin/xlint/lint1/msg_232.c cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_232.exp cvs rdiff -u -r1.197 -r1.198 src/usr.bin/xlint/lint1/decl.c cvs rdiff -u -r1.127 -r1.128 src/usr.bin/xlint/lint1/err.c 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_023.c diff -u src/tests/usr.bin/xlint/lint1/msg_023.c:1.3 src/tests/usr.bin/xlint/lint1/msg_023.c:1.4 --- src/tests/usr.bin/xlint/lint1/msg_023.c:1.3 Sun Jul 11 19:24:42 2021 +++ src/tests/usr.bin/xlint/lint1/msg_023.c Sun Jul 11 19:30:56 2021 @@ -1,14 +1,13 @@ -/* $NetBSD: msg_023.c,v 1.3 2021/07/11 19:24:42 rillig Exp $ */ +/* $NetBSD: msg_023.c,v 1.4 2021/07/11 19:30:56 rillig Exp $ */ # 3 "msg_023.c" -// Test for message: undefined label %s [23] +// Test for message: undefined label '%s' [23] void test(void) { goto defined_label; defined_label: - /* TODO: add quotes around '%s' */ - /* expect+1: warning: undefined label undefined_label [23] */ + /* expect+1: warning: undefined label 'undefined_label' [23] */ goto undefined_label; } Index: src/tests/usr.bin/xlint/lint1/msg_023.exp diff -u src/tests/usr.bin/xlint/lint1/msg_023.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_023.exp:1.4 --- src/tests/usr.bin/xlint/lint1/msg_023.exp:1.3 Sun Jul 11 19:24:42 2021 +++ src/tests/usr.bin/xlint/lint1/msg_023.exp Sun Jul 11 19:30:56 2021 @@ -1 +1 @@ -msg_023.c(13): warning: undefined label undefined_label [23] +msg_023.c(12): warning: undefined label 'undefined_label' [23] Index: src/tests/usr.bin/xlint/lint1/msg_194.exp diff -u src/tests/usr.bin/xlint/lint1/msg_194.exp:1.3 src/tests/usr.bin/xlint/lint1/msg_194.exp:1.4 --- src/tests/usr.bin/xlint/lint1/msg_194.exp:1.3 Sun Mar 21 20:45:00 2021 +++ src/tests/usr.bin/xlint/lint1/msg_194.exp Sun Jul 11 19:30:56 2021 @@ -1,2 +1,2 @@ msg_194.c(11): error: label label redefined [194] -msg_194.c(9): warning: label label unused in function example [232] +msg_194.c(9): warning: label 'label' unused in function 'example' [232] Index: src/tests/usr.bin/xlint/lint1/msg_193.c diff -u src/tests/usr.bin/xlint/lint1/msg_193.c:1.11 src/tests/usr.bin/xlint/lint1/msg_193.c:1.12 --- src/tests/usr.bin/xlint/lint1/msg_193.c:1.11 Sun Mar 21 20:08:21 2021 +++ src/tests/usr.bin/xlint/lint1/msg_193.c Sun Jul 11 19:30:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: msg_193.c,v 1.11 2021/03/21 20:08:21 rillig Exp $ */ +/* $NetBSD: msg_193.c,v 1.12 2021/07/11 19:30:56 rillig Exp $ */ # 3 "msg_193.c" // Test for message: statement not reached [193] @@ -577,7 +577,7 @@ one: goto two; seven: goto eight; -six: /* expect: warning: label six unused */ +six: /* expect: warning: label 'six' unused */ goto seven; ten: return; Index: src/tests/usr.bin/xlint/lint1/msg_193.exp diff -u src/tests/usr.bin/xlint/lint1/msg_193.exp:1.11 src/tests/usr.bin/xlint/lint1/msg_193.exp:1.12 --- src/tests/usr.bin/xlint/lint1/msg_193.exp:1.11 Sun Mar 21 20:08:21 2021 +++ src/tests/usr.bin/xlint/lint1/msg_193.exp Sun Jul 11 19:30:56 2021 @@ -82,6 +82,6 @@ msg_193.c(515): warning: statement not r msg_193.c(518): warning: statement not reached [193] msg_193.c(532): warning: statement not reached [193] msg_193.c(540): warning: statement not reached [193] -msg_193.c(580): warning: label six unused in function test_goto_numbers_alphabetically [232] +msg_193.c(580): warning: label 'six' unused in function 'test_goto_numbers_alphabetically' [232] msg_193.c(597): warning: statement not reached [193] msg_193.c(606): warning: statement not reached [193] Index: src/tests/usr.bin/xlint/lint1/msg_232.c diff -u src/tests/usr.bin/xlint/lint1/msg_232.c:1.4 src/tests/usr.bin/xlint/lint1/msg_232.c:1.5 --- src/tests/usr.bin/xlint/lint1/msg_232.c:1.4 Sun Jul 11 19:24:42 2021 +++ src/tests/usr.bin/xlint/lint1/msg_232.c Sun Jul 11 19:30:56 2021 @@ -1,16 +1,15 @@ -/* $NetBSD: msg_232.c,v 1.4 2021/07/11 19:24:42 rillig Exp $ */ +/* $NetBSD: msg_232.c,v 1.5 2021/07/11 19:30:56 rillig Exp $ */ # 3 "msg_232.c" -// Test for message: label %s unused in function %s [232] +// Test for message: label '%s' unused in function '%s' [232] void example(void) { goto used_label; -unused_label: /* expect: 232 */ + /* expect+1: label 'unused_label' unused in function 'example' [232] */ +unused_label: return; used_label: return; } - -/* TODO: add quotes around '%s' */ Index: src/tests/usr.bin/xlint/lint1/msg_232.exp diff -u src/tests/usr.bin/xlint/lint1/msg_232.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_232.exp:1.3 --- src/tests/usr.bin/xlint/lint1/msg_232.exp:1.2 Sun Jan 10 13:54:13 2021 +++ src/tests/usr.bin/xlint/lint1/msg_232.exp Sun Jul 11 19:30:56 2021 @@ -1 +1 @@ -msg_232.c(10): warning: label unused_label unused in function example [232] +msg_232.c(11): warning: label 'unused_label' unused in function 'example' [232] Index: src/usr.bin/xlint/lint1/decl.c diff -u src/usr.bin/xlint/lint1/decl.c:1.197 src/usr.bin/xlint/lint1/decl.c:1.198 --- src/usr.bin/xlint/lint1/decl.c:1.197 Sat Jul 10 17:35:54 2021 +++ src/usr.bin/xlint/lint1/decl.c Sun Jul 11 19:30:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: decl.c,v 1.197 2021/07/10 17:35:54 rillig Exp $ */ +/* $NetBSD: decl.c,v 1.198 2021/07/11 19:30:56 rillig Exp $ */ /* * Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved. @@ -38,7 +38,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: decl.c,v 1.197 2021/07/10 17:35:54 rillig Exp $"); +__RCSID("$NetBSD: decl.c,v 1.198 2021/07/11 19:30:56 rillig Exp $"); #endif #include <sys/param.h> @@ -3131,10 +3131,10 @@ check_label_usage(sym_t *lab) lint_assert(lab->s_block_level == 1); if (lab->s_set && !lab->s_used) { - /* label %s unused in function %s */ + /* label '%s' unused in function '%s' */ warning_at(232, &lab->s_set_pos, lab->s_name, funcsym->s_name); } else if (!lab->s_set) { - /* undefined label %s */ + /* undefined label '%s' */ warning_at(23, &lab->s_use_pos, lab->s_name); } } Index: src/usr.bin/xlint/lint1/err.c diff -u src/usr.bin/xlint/lint1/err.c:1.127 src/usr.bin/xlint/lint1/err.c:1.128 --- src/usr.bin/xlint/lint1/err.c:1.127 Sat Jul 10 12:17:31 2021 +++ src/usr.bin/xlint/lint1/err.c Sun Jul 11 19:30:56 2021 @@ -1,4 +1,4 @@ -/* $NetBSD: err.c,v 1.127 2021/07/10 12:17:31 rillig Exp $ */ +/* $NetBSD: err.c,v 1.128 2021/07/11 19:30:56 rillig Exp $ */ /* * Copyright (c) 1994, 1995 Jochen Pohl @@ -37,7 +37,7 @@ #include <sys/cdefs.h> #if defined(__RCSID) && !defined(lint) -__RCSID("$NetBSD: err.c,v 1.127 2021/07/10 12:17:31 rillig Exp $"); +__RCSID("$NetBSD: err.c,v 1.128 2021/07/11 19:30:56 rillig Exp $"); #endif #include <sys/types.h> @@ -77,7 +77,7 @@ const char *const msgs[] = { "negative array dimension (%d)", /* 20 */ "redeclaration of formal parameter %s", /* 21 */ "incomplete or misplaced function definition", /* 22 */ - "undefined label %s", /* 23 */ + "undefined label '%s'", /* 23 */ "cannot initialize function: %s", /* 24 */ "cannot initialize typedef: %s", /* 25 */ "cannot initialize extern declaration: %s", /* 26 */ @@ -286,7 +286,7 @@ const char *const msgs[] = { "converting '%s' to '%s' is questionable", /* 229 */ "nonportable character comparison, op %s", /* 230 */ "argument '%s' unused in function '%s'", /* 231 */ - "label %s unused in function %s", /* 232 */ + "label '%s' unused in function '%s'", /* 232 */ "struct %s never defined", /* 233 */ "union %s never defined", /* 234 */ "enum %s never defined", /* 235 */