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 several placehol...



details:   https://anonhg.NetBSD.org/src/rev/3c0d0eba97f6
branches:  trunk
changeset: 367266:3c0d0eba97f6
user:      rillig <rillig%NetBSD.org@localhost>
date:      Mon Jun 20 21:13:35 2022 +0000

description:
lint: add quotes around several placeholders in messages

diffstat:

 tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c |   2 +-
 tests/usr.bin/xlint/lint1/decl_arg.c                   |  30 +++++-----
 tests/usr.bin/xlint/lint1/msg_019.c                    |   4 +-
 tests/usr.bin/xlint/lint1/msg_021.c                    |   4 +-
 tests/usr.bin/xlint/lint1/msg_032.c                    |  10 +-
 tests/usr.bin/xlint/lint1/msg_039.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_043.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_044.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_045.c                    |   4 +-
 tests/usr.bin/xlint/lint1/msg_047.c                    |   4 +-
 tests/usr.bin/xlint/lint1/msg_048.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_050.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_052.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_053.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_057.c                    |  10 +-
 tests/usr.bin/xlint/lint1/msg_058.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_059.c                    |   8 +-
 tests/usr.bin/xlint/lint1/msg_061.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_086.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_087.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_088.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_091.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_100.c                    |   6 +-
 usr.bin/xlint/lint1/cgram.y                            |   6 +-
 usr.bin/xlint/lint1/decl.c                             |  46 +++++++++---------
 usr.bin/xlint/lint1/err.c                              |  38 +++++++-------
 usr.bin/xlint/lint1/func.c                             |   6 +-
 27 files changed, 128 insertions(+), 128 deletions(-)

diffs (truncated from 835 to 300 lines):

diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c
--- a/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c    Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/d_decl_old_style_arguments.c    Mon Jun 20 21:13:35 2022 +0000
@@ -16,6 +16,6 @@
     char *ptr;
     double dbl;
 {
-       /* expect-1: warning: argument type defaults to 'int': def [32] */
+       /* expect-1: warning: type of argument 'def' defaults to 'int' [32] */
        /* expect-2: error: parameter mismatch: 3 declared, 4 defined [51] */
 }
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/decl_arg.c
--- a/tests/usr.bin/xlint/lint1/decl_arg.c      Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/decl_arg.c      Mon Jun 20 21:13:35 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: decl_arg.c,v 1.6 2021/07/25 06:04:40 rillig Exp $      */
+/*     $NetBSD: decl_arg.c,v 1.7 2022/06/20 21:13:36 rillig Exp $      */
 # 3 "decl_arg.c"
 
 /*
@@ -35,16 +35,16 @@
 static "error";
 /* expect+1: warning: empty declaration [2] */
 const;
-/* expect+1: error: declared argument undeclared is missing [53] */
+/* expect+1: error: declared argument 'undeclared' is missing [53] */
 const undeclared;
-/* expect+2: error: declared argument undeclared_initialized is missing [53] */
-/* expect+1: error: cannot initialize parameter: undeclared_initialized [52] */
+/* expect+2: error: declared argument 'undeclared_initialized' is missing [53] */
+/* expect+1: error: cannot initialize parameter 'undeclared_initialized' [52] */
 const undeclared_initialized = 12345;
 /* expect+1: warning: empty declaration [2] */
 int;
 /* expect+1: warning: 'struct arg_struct' declared in argument declaration list [3] */
 struct arg_struct { int member; };
-/* expect+1: error: cannot initialize parameter: an_int [52] */
+/* expect+1: error: cannot initialize parameter 'an_int' [52] */
 int an_int = 12345;
 const int a_const_int;
 number a_number;
@@ -61,27 +61,27 @@
 extern int
 cover_notype_direct_decl(arg)
 int arg;
-/* expect+1: error: declared argument name is missing [53] */
+/* expect+1: error: declared argument 'name' is missing [53] */
 const name;
-/* expect+1: error: declared argument parenthesized_name is missing [53] */
+/* expect+1: error: declared argument 'parenthesized_name' is missing [53] */
 const (parenthesized_name);
-/* expect+1: error: declared argument array is missing [53] */
+/* expect+1: error: declared argument 'array' is missing [53] */
 const array[];
-/* expect+1: error: declared argument array_size is missing [53] */
+/* expect+1: error: declared argument 'array_size' is missing [53] */
 const array_size[1+1+1];
-/* expect+2: error: declared argument multi_array is missing [53] */
+/* expect+2: error: declared argument 'multi_array' is missing [53] */
 /* expect+1: error: null dimension [17] */
 const multi_array[][][][][][];
-/* expect+1: error: declared argument function is missing [53] */
+/* expect+1: error: declared argument 'function' is missing [53] */
 const function(void);
-/* expect+1: error: declared argument prefix_attribute is missing [53] */
+/* expect+1: error: declared argument 'prefix_attribute' is missing [53] */
 const __attribute__((deprecated)) prefix_attribute;
-/* expect+1: error: declared argument postfix_attribute is missing [53] */
+/* expect+1: error: declared argument 'postfix_attribute' is missing [53] */
 const postfix_attribute __attribute__((deprecated));
-/* expect+1: error: declared argument infix_attribute is missing [53] */
+/* expect+1: error: declared argument 'infix_attribute' is missing [53] */
 const __attribute__((deprecated)) infix_attribute __attribute__((deprecated));
 /* The __attribute__ before the '*' is consumed by some other grammar rule. */
-/* expect+7: error: declared argument pointer_prefix_attribute is missing [53] */
+/* expect+7: error: declared argument 'pointer_prefix_attribute' is missing [53] */
 const
     __attribute__((deprecated))
     *
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_019.c
--- a/tests/usr.bin/xlint/lint1/msg_019.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_019.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_019.c,v 1.5 2022/06/15 20:18:31 rillig Exp $       */
+/*     $NetBSD: msg_019.c,v 1.6 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_019.c"
 
 // Test for message: void type for '%s' [19]
@@ -11,7 +11,7 @@
 static void unit_variable;
 
 /* expect+3: warning: argument 'parameter' unused in function 'function' [231] */
-/* expect+2: error: void parameter cannot have name: parameter [61] */
+/* expect+2: error: void parameter 'parameter' cannot have name [61] */
 void
 function(void parameter)
 {
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_021.c
--- a/tests/usr.bin/xlint/lint1/msg_021.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_021.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_021.c,v 1.3 2022/06/11 12:24:00 rillig Exp $       */
+/*     $NetBSD: msg_021.c,v 1.4 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_021.c"
 
 // Test for message: redeclaration of formal parameter '%s' [21]
@@ -11,7 +11,7 @@
 old_style_with_duplicate_parameter(parameter, parameter)
     int parameter;
 {
-       /* expect-1: warning: argument type defaults to 'int': parameter [32] */
+       /* expect-1: warning: type of argument 'parameter' defaults to 'int' [32] */
 }
 
 void
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_032.c
--- a/tests/usr.bin/xlint/lint1/msg_032.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_032.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,13 +1,13 @@
-/*     $NetBSD: msg_032.c,v 1.4 2022/04/24 20:08:23 rillig Exp $       */
+/*     $NetBSD: msg_032.c,v 1.5 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_032.c"
 
-// Test for message: argument type defaults to 'int': %s [32]
+// Test for message: type of argument '%s' defaults to 'int' [32]
 
 /* expect+5: error: old style declaration; add 'int' [1] */
 add(a, b, c)
-/* expect+3: warning: argument type defaults to 'int': a [32] */
-/* expect+2: warning: argument type defaults to 'int': b [32] */
-/* expect+1: warning: argument type defaults to 'int': c [32] */
+/* expect+3: warning: type of argument 'a' defaults to 'int' [32] */
+/* expect+2: warning: type of argument 'b' defaults to 'int' [32] */
+/* expect+1: warning: type of argument 'c' defaults to 'int' [32] */
 {
        return a + b + c;
 }
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_039.c
--- a/tests/usr.bin/xlint/lint1/msg_039.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_039.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,13 +1,13 @@
-/*     $NetBSD: msg_039.c,v 1.3 2022/04/05 23:09:19 rillig Exp $       */
+/*     $NetBSD: msg_039.c,v 1.4 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_039.c"
 
-/* Test for message: zero sized array in struct is a C99 extension: %s [39] */
+/* Test for message: zero-sized array '%s' in struct is a C99 extension [39] */
 
 /* lint1-flags: -w */
 
 struct s {
        /* expect+2: warning: zero sized array is a C99 extension [322] */
-       /* expect+1: warning: zero sized array in struct is a C99 extension: member [39] */
+       /* expect+1: warning: zero-sized array 'member' in struct is a C99 extension [39] */
        char member[0];
        char member2;
 };
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_043.c
--- a/tests/usr.bin/xlint/lint1/msg_043.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_043.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_043.c,v 1.3 2022/04/08 21:29:29 rillig Exp $       */
+/*     $NetBSD: msg_043.c,v 1.4 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_043.c"
 
-/* Test for message: redefinition hides earlier one: %s [43] */
+/* Test for message: redefinition of '%s' hides earlier one [43] */
 
 /* lint1-extra-flags: -h */
 
@@ -12,7 +12,7 @@
 void
 example(void)
 {
-       /* expect+1: warning: redefinition hides earlier one: s [43] */
+       /* expect+1: warning: redefinition of 's' hides earlier one [43] */
        struct s {
                int member;
        };
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_044.c
--- a/tests/usr.bin/xlint/lint1/msg_044.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_044.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_044.c,v 1.4 2022/06/11 11:52:13 rillig Exp $       */
+/*     $NetBSD: msg_044.c,v 1.5 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_044.c"
 
-// Test for message: declaration introduces new type in ANSI C: %s %s [44]
+// Test for message: declaration of '%s %s' introduces new type in ANSI C [44]
 
 /* expect+1: warning: struct 'tag' never defined [233] */
 struct tag;
@@ -9,7 +9,7 @@
 void declaration(struct tag *);
 
 void definition(void) {
-       /* expect+2: warning: declaration introduces new type in ANSI C: struct tag [44] */
+       /* expect+2: warning: declaration of 'struct tag' introduces new type in ANSI C [44] */
        /* expect+1: warning: struct 'tag' never defined [233] */
        struct tag;
 }
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_045.c
--- a/tests/usr.bin/xlint/lint1/msg_045.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_045.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_045.c,v 1.5 2022/06/19 12:14:34 rillig Exp $       */
+/*     $NetBSD: msg_045.c,v 1.6 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_045.c"
 
 /* Test for message: base type is really '%s %s' [45] */
@@ -12,7 +12,7 @@
 function()
 {
        /* expect+4: warning: base type is really 'struct counter' [45] */
-       /* expect+3: warning: declaration introduces new type in ANSI C: union counter [44] */
+       /* expect+3: warning: declaration of 'union counter' introduces new type in ANSI C [44] */
        /* expect+2: error: 'counter' has incomplete type 'incomplete union counter' [31] */
        /* expect+1: warning: union 'counter' never defined [234] */
        union counter counter;
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_047.c
--- a/tests/usr.bin/xlint/lint1/msg_047.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_047.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_047.c,v 1.4 2022/02/27 12:00:27 rillig Exp $       */
+/*     $NetBSD: msg_047.c,v 1.5 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_047.c"
 
 /* Test for message: zero sized %s is a C99 feature [47] */
@@ -12,7 +12,7 @@
 
 struct zero_sized {
        /* expect+2: error: zero sized array is a C99 extension [322] */
-       /* expect+1: error: zero sized array in struct is a C99 extension: dummy [39] */
+       /* expect+1: error: zero-sized array 'dummy' in struct is a C99 extension [39] */
        char dummy[0];
 };
 /* expect-1: error: zero sized struct is a C99 feature [47] */
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_048.c
--- a/tests/usr.bin/xlint/lint1/msg_048.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_048.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_048.c,v 1.5 2022/06/17 18:54:53 rillig Exp $       */
+/*     $NetBSD: msg_048.c,v 1.6 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_048.c"
 
-// Test for message: overflow in enumeration values: %s [48]
+// Test for message: enumeration value '%s' overflows [48]
 
 /*
  * Before decl.c 1.269 from 2022-04-08, the comparison for enum constant
@@ -16,7 +16,7 @@
        MAX_MINUS_2 = 0x7ffffffd,
        MAX_MINUS_1,
        MAX,
-       /* expect+1: warning: overflow in enumeration values: MIN [48] */
+       /* expect+1: warning: enumeration value 'MIN' overflows [48] */
        MIN,
        MIN_PLUS_1
 };
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_050.c
--- a/tests/usr.bin/xlint/lint1/msg_050.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_050.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_050.c,v 1.4 2022/06/15 20:18:31 rillig Exp $       */
+/*     $NetBSD: msg_050.c,v 1.5 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_050.c"
 
-/* Test for message: a function is declared as an argument: %s [50] */
+/* Test for message: argument '%s' has function type, should be pointer [50] */
 
 /* lint1-flags: -Stw */
 
@@ -9,7 +9,7 @@
 
 /* expect+1: warning: argument 'f' unused in function 'example' [231] */
 void example(f)
-    /* expect+1: warning: a function is declared as an argument: f [50] */
+    /* expect+1: warning: argument 'f' has function type, should be pointer [50] */
     function f;
 {
 }
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_052.c
--- a/tests/usr.bin/xlint/lint1/msg_052.c       Mon Jun 20 18:06:28 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_052.c       Mon Jun 20 21:13:35 2022 +0000
@@ -1,11 +1,11 @@
-/*     $NetBSD: msg_052.c,v 1.3 2021/08/27 20:16:50 rillig Exp $       */
+/*     $NetBSD: msg_052.c,v 1.4 2022/06/20 21:13:36 rillig Exp $       */
 # 3 "msg_052.c"
 
-// Test for message: cannot initialize parameter: %s [52]
+// Test for message: cannot initialize parameter '%s' [52]
 
 int
 definition(i)
-       /* expect+1: error: cannot initialize parameter: i [52] */
+       /* expect+1: error: cannot initialize parameter 'i' [52] */
        int i = 3;
 {
        return i;
diff -r 52555fe17e26 -r 3c0d0eba97f6 tests/usr.bin/xlint/lint1/msg_053.c



Home | Main Index | Thread Index | Old Index