Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/lint1 lint: add quotes around placeholders in ...



details:   https://anonhg.NetBSD.org/src/rev/3c26284204b2
branches:  trunk
changeset: 1022293:3c26284204b2
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jul 11 19:30:56 2021 +0000

description:
lint: add quotes around placeholders in message 23 and 232

diffstat:

 tests/usr.bin/xlint/lint1/msg_023.c   |  7 +++----
 tests/usr.bin/xlint/lint1/msg_023.exp |  2 +-
 tests/usr.bin/xlint/lint1/msg_193.c   |  4 ++--
 tests/usr.bin/xlint/lint1/msg_193.exp |  2 +-
 tests/usr.bin/xlint/lint1/msg_194.exp |  2 +-
 tests/usr.bin/xlint/lint1/msg_232.c   |  9 ++++-----
 tests/usr.bin/xlint/lint1/msg_232.exp |  2 +-
 usr.bin/xlint/lint1/decl.c            |  8 ++++----
 usr.bin/xlint/lint1/err.c             |  8 ++++----
 9 files changed, 21 insertions(+), 23 deletions(-)

diffs (160 lines):

diff -r b9952b9f1eba -r 3c26284204b2 tests/usr.bin/xlint/lint1/msg_023.c
--- a/tests/usr.bin/xlint/lint1/msg_023.c       Sun Jul 11 19:24:41 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_023.c       Sun Jul 11 19:30:56 2021 +0000
@@ -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;
 }
diff -r b9952b9f1eba -r 3c26284204b2 tests/usr.bin/xlint/lint1/msg_023.exp
--- a/tests/usr.bin/xlint/lint1/msg_023.exp     Sun Jul 11 19:24:41 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_023.exp     Sun Jul 11 19:30:56 2021 +0000
@@ -1,1 +1,1 @@
-msg_023.c(13): warning: undefined label undefined_label [23]
+msg_023.c(12): warning: undefined label 'undefined_label' [23]
diff -r b9952b9f1eba -r 3c26284204b2 tests/usr.bin/xlint/lint1/msg_193.c
--- a/tests/usr.bin/xlint/lint1/msg_193.c       Sun Jul 11 19:24:41 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_193.c       Sun Jul 11 19:30:56 2021 +0000
@@ -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 @@
        goto two;
 seven:
        goto eight;
-six:                           /* expect: warning: label six unused */
+six:                           /* expect: warning: label 'six' unused */
        goto seven;
 ten:
        return;
diff -r b9952b9f1eba -r 3c26284204b2 tests/usr.bin/xlint/lint1/msg_193.exp
--- a/tests/usr.bin/xlint/lint1/msg_193.exp     Sun Jul 11 19:24:41 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_193.exp     Sun Jul 11 19:30:56 2021 +0000
@@ -82,6 +82,6 @@
 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]
diff -r b9952b9f1eba -r 3c26284204b2 tests/usr.bin/xlint/lint1/msg_194.exp
--- a/tests/usr.bin/xlint/lint1/msg_194.exp     Sun Jul 11 19:24:41 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_194.exp     Sun Jul 11 19:30:56 2021 +0000
@@ -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]
diff -r b9952b9f1eba -r 3c26284204b2 tests/usr.bin/xlint/lint1/msg_232.c
--- a/tests/usr.bin/xlint/lint1/msg_232.c       Sun Jul 11 19:24:41 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_232.c       Sun Jul 11 19:30:56 2021 +0000
@@ -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' */
diff -r b9952b9f1eba -r 3c26284204b2 tests/usr.bin/xlint/lint1/msg_232.exp
--- a/tests/usr.bin/xlint/lint1/msg_232.exp     Sun Jul 11 19:24:41 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_232.exp     Sun Jul 11 19:30:56 2021 +0000
@@ -1,1 +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]
diff -r b9952b9f1eba -r 3c26284204b2 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Sun Jul 11 19:24:41 2021 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Sun Jul 11 19:30:56 2021 +0000
@@ -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 @@
        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);
        }
 }
diff -r b9952b9f1eba -r 3c26284204b2 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Jul 11 19:24:41 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Jul 11 19:30:56 2021 +0000
@@ -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 @@
        "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 @@
        "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 */



Home | Main Index | Thread Index | Old Index