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 and details to some mor...



details:   https://anonhg.NetBSD.org/src/rev/96e962cbf6ce
branches:  trunk
changeset: 367681:96e962cbf6ce
user:      rillig <rillig%NetBSD.org@localhost>
date:      Tue Jun 21 21:18:30 2022 +0000

description:
lint: add quotes and details to some more messages

diffstat:

 tests/usr.bin/xlint/lint1/msg_062.c |   4 ++--
 tests/usr.bin/xlint/lint1/msg_085.c |  10 +++++-----
 tests/usr.bin/xlint/lint1/msg_090.c |   6 +++---
 tests/usr.bin/xlint/lint1/msg_092.c |   8 ++++----
 tests/usr.bin/xlint/lint1/msg_093.c |   6 +++---
 tests/usr.bin/xlint/lint1/msg_094.c |   6 +++---
 tests/usr.bin/xlint/lint1/msg_095.c |   6 +++---
 tests/usr.bin/xlint/lint1/msg_096.c |   6 +++---
 tests/usr.bin/xlint/lint1/msg_108.c |  10 +++++-----
 tests/usr.bin/xlint/lint1/msg_114.c |   4 ++--
 tests/usr.bin/xlint/lint1/msg_343.c |   4 ++--
 usr.bin/xlint/lint1/decl.c          |  16 ++++++++--------
 usr.bin/xlint/lint1/err.c           |  22 +++++++++++-----------
 usr.bin/xlint/lint1/tree.c          |  16 ++++++++--------
 14 files changed, 62 insertions(+), 62 deletions(-)

diffs (truncated from 412 to 300 lines):

diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_062.c
--- a/tests/usr.bin/xlint/lint1/msg_062.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_062.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_062.c,v 1.4 2022/04/24 20:08:23 rillig Exp $       */
+/*     $NetBSD: msg_062.c,v 1.5 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_062.c"
 
 // Test for message: function prototype parameters must have types [62]
@@ -6,6 +6,6 @@
 /* expect+1: error: old style declaration; add 'int' [1] */
 outer() {
        /* expect+2: warning: function prototype parameters must have types [62] */
-       /* expect+1: warning: dubious static function at block level: inner [93] */
+       /* expect+1: warning: dubious static function 'inner' at block level [93] */
        static int inner(a);
 }
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_085.c
--- a/tests/usr.bin/xlint/lint1/msg_085.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_085.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,13 +1,13 @@
-/*     $NetBSD: msg_085.c,v 1.4 2022/06/15 20:18:31 rillig Exp $       */
+/*     $NetBSD: msg_085.c,v 1.5 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_085.c"
 
-// Test for message: dubious tag declaration: %s %s [85]
+// Test for message: dubious tag declaration '%s %s' [85]
 
-/* expect+1: warning: dubious tag declaration: struct in_argument [85] */
+/* expect+1: warning: dubious tag declaration 'struct in_argument' [85] */
 void declare_struct(struct in_argument *);
-/* expect+1: warning: dubious tag declaration: union in_argument [85] */
+/* expect+1: warning: dubious tag declaration 'union in_argument' [85] */
 void declare_union(union in_argument *);
-/* expect+1: warning: dubious tag declaration: enum in_argument [85] */
+/* expect+1: warning: dubious tag declaration 'enum in_argument' [85] */
 void declare_enum(enum in_argument *);
 
 /* expect+1: warning: struct 'ok' never defined [233] */
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_090.c
--- a/tests/usr.bin/xlint/lint1/msg_090.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_090.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,13 +1,13 @@
-/*     $NetBSD: msg_090.c,v 1.3 2022/04/03 09:34:45 rillig Exp $       */
+/*     $NetBSD: msg_090.c,v 1.4 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_090.c"
 
-// Test for message: inconsistent redeclaration of extern: %s [90]
+// Test for message: inconsistent redeclaration of extern '%s' [90]
 
 extern int random_number(void);
 
 void
 use(void)
 {
-       /* expect+1: warning: inconsistent redeclaration of extern: random_number [90] */
+       /* expect+1: warning: inconsistent redeclaration of extern 'random_number' [90] */
        extern int random_number(int);
 }
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_092.c
--- a/tests/usr.bin/xlint/lint1/msg_092.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_092.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_092.c,v 1.3 2022/04/03 09:34:45 rillig Exp $       */
+/*     $NetBSD: msg_092.c,v 1.4 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_092.c"
 
-// Test for message: inconsistent redeclaration of static: %s [92]
+// Test for message: inconsistent redeclaration of static '%s' [92]
 
 static int
 random(void)
@@ -14,7 +14,7 @@
 {
        random();
 
-       /* expect+2: warning: dubious static function at block level: random [93] */
-       /* expect+1: warning: inconsistent redeclaration of static: random [92] */
+       /* expect+2: warning: dubious static function 'random' at block level [93] */
+       /* expect+1: warning: inconsistent redeclaration of static 'random' [92] */
        static double random(void);
 }
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_093.c
--- a/tests/usr.bin/xlint/lint1/msg_093.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_093.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,12 +1,12 @@
-/*     $NetBSD: msg_093.c,v 1.4 2022/04/03 09:34:45 rillig Exp $       */
+/*     $NetBSD: msg_093.c,v 1.5 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_093.c"
 
-// Test for message: dubious static function at block level: %s [93]
+// Test for message: dubious static function '%s' at block level [93]
 
 void
 example(void)
 {
-       /* expect+1: warning: dubious static function at block level: nested [93] */
+       /* expect+1: warning: dubious static function 'nested' at block level [93] */
        static void nested(void);
 
        nested();
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_094.c
--- a/tests/usr.bin/xlint/lint1/msg_094.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_094.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,13 +1,13 @@
-/*     $NetBSD: msg_094.c,v 1.4 2022/04/03 09:34:45 rillig Exp $       */
+/*     $NetBSD: msg_094.c,v 1.5 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_094.c"
 
-// Test for message: function has illegal storage class: %s [94]
+// Test for message: function '%s' has illegal storage class [94]
 
 /* expect+2: error: illegal storage class [8] */
 register int
 global_example(int arg)
 {
-       /* expect+1: error: function has illegal storage class: register_example [94] */
+       /* expect+1: error: function 'register_example' has illegal storage class [94] */
        register int register_example(int);
 
        return arg;
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_095.c
--- a/tests/usr.bin/xlint/lint1/msg_095.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_095.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_095.c,v 1.4 2022/04/03 09:34:45 rillig Exp $       */
+/*     $NetBSD: msg_095.c,v 1.5 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_095.c"
 
-// Test for message: declaration hides earlier one: %s [95]
+// Test for message: declaration of '%s' hides earlier one [95]
 
 /* lint1-flags: -ghSw */
 
@@ -12,7 +12,7 @@
 {
 
        {
-               /* expect+1: warning: declaration hides earlier one: identifier [95] */
+               /* expect+1: warning: declaration of 'identifier' hides earlier one [95] */
                int identifier = 3;
        }
 
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_096.c
--- a/tests/usr.bin/xlint/lint1/msg_096.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_096.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_096.c,v 1.5 2022/04/03 09:34:45 rillig Exp $       */
+/*     $NetBSD: msg_096.c,v 1.6 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_096.c"
 
-// Test for message: cannot dereference non-pointer type [96]
+// Test for message: cannot dereference non-pointer type '%s' [96]
 
 int
 unary_plus(int i)
@@ -20,6 +20,6 @@
 {
        i++;
 
-       /* expect+1: error: cannot dereference non-pointer type [96] */
+       /* expect+1: error: cannot dereference non-pointer type 'int' [96] */
        return *i;
 }
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_108.c
--- a/tests/usr.bin/xlint/lint1/msg_108.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_108.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_108.c,v 1.6 2022/06/16 16:58:36 rillig Exp $       */
+/*     $NetBSD: msg_108.c,v 1.7 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_108.c"
 
-// Test for message: operand of '%s' has invalid type (%s) [108]
+// Test for message: operand of '%s' has invalid type '%s' [108]
 
 /*
  * Before tree.c 1.137 from 2021-01-19, taking the complement of a struct
@@ -9,8 +9,8 @@
  * message 108 had two operands, the second of which was always NOTSPEC, as
  * could be expected for a unary operator.
  *
- * Since an error "invalid type (none)" doesn't make sense, lint rather
- * chooses to crash than to generate such an error.
+ * Since an error "invalid type 'none'" doesn't make sense, lint rather chose
+ * to crash than to generate such an error.
  */
 void
 complement_of_a_struct(void)
@@ -21,6 +21,6 @@
            0
        };
 
-       /* expect+1: error: operand of '~' has invalid type (struct) [108] */
+       /* expect+1: error: operand of '~' has invalid type 'struct s' [108] */
        s = ~s;
 }
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_114.c
--- a/tests/usr.bin/xlint/lint1/msg_114.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_114.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_114.c,v 1.5 2022/06/16 16:58:36 rillig Exp $       */
+/*     $NetBSD: msg_114.c,v 1.6 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_114.c"
 
 // Test for message: %soperand of '%s' must be lvalue [114]
@@ -16,7 +16,7 @@
         *
         * See msg_108.c for more details.
         */
-       /* expect+1: error: operand of 'x++' has invalid type (array) [108] */
+       /* expect+1: error: operand of 'x++' has invalid type 'array[7] of char' [108] */
        "string"++;
 
        /* expect+1: error: operand of 'x++' must be lvalue [114] */
diff -r 55b9fa49864f -r 96e962cbf6ce tests/usr.bin/xlint/lint1/msg_343.c
--- a/tests/usr.bin/xlint/lint1/msg_343.c       Tue Jun 21 16:24:37 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_343.c       Tue Jun 21 21:18:30 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_343.c,v 1.7 2022/06/17 18:54:53 rillig Exp $       */
+/*     $NetBSD: msg_343.c,v 1.8 2022/06/21 21:18:30 rillig Exp $       */
 # 3 "msg_343.c"
 
 /* Test for message: static array size is a C11 extension [343] */
@@ -35,7 +35,7 @@
 /* expect+1: error: syntax error '3' [249] */
 returns_volatile_int_array(int a[volatile 3])
 {
-       /* expect+2: error: cannot dereference non-pointer type [96] */
+       /* expect+2: error: cannot dereference non-pointer type 'int' [96] */
        /* expect+1: ... expects to return value [214] */
        return a[0];
 }
diff -r 55b9fa49864f -r 96e962cbf6ce usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c        Tue Jun 21 16:24:37 2022 +0000
+++ b/usr.bin/xlint/lint1/decl.c        Tue Jun 21 21:18:30 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.290 2022/06/20 21:13:35 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.291 2022/06/21 21:18:30 rillig Exp $ */
 
 /*
  * Copyright (c) 1996 Christopher G. Demetriou.  All Rights Reserved.
@@ -38,7 +38,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.290 2022/06/20 21:13:35 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.291 2022/06/21 21:18:30 rillig Exp $");
 #endif
 
 #include <sys/param.h>
@@ -1477,7 +1477,7 @@
        for (sym = dcs->d_dlsyms; sym != NULL; sym = sym->s_level_next) {
                sc = sym->s_scl;
                if (sc == STRUCT_TAG || sc == UNION_TAG || sc == ENUM_TAG) {
-                       /* dubious tag declaration: %s %s */
+                       /* dubious tag declaration '%s %s' */
                        warning(85, storage_class_name(sc), sym->s_name);
                }
        }
@@ -2722,7 +2722,7 @@
 
        } else if (rsym->s_block_level < block_level) {
                if (hflag)
-                       /* declaration hides earlier one: %s */
+                       /* declaration of '%s' hides earlier one */
                        warning(95, dsym->s_name);
        }
 
@@ -2749,11 +2749,11 @@
 
        if (dsym->s_type->t_tspec == FUNC) {
                if (dsym->s_scl == STATIC) {
-                       /* dubious static function at block level: %s */
+                       /* dubious static function '%s' at block level */
                        warning(93, dsym->s_name);
                        dsym->s_scl = EXTERN;
                } else if (dsym->s_scl != EXTERN && dsym->s_scl != TYPEDEF) {
-                       /* function has illegal storage class: %s */
+                       /* function '%s' has illegal storage class */
                        error(94, dsym->s_name);
                        dsym->s_scl = EXTERN;
                }
@@ -2848,11 +2848,11 @@
 
        if (!eqt || dowarn) {
                if (esym->s_scl == EXTERN) {
-                       /* inconsistent redeclaration of extern: %s */
+                       /* inconsistent redeclaration of extern '%s' */
                        warning(90, dsym->s_name);
                        print_previous_declaration(-1, esym);
                } else {
-                       /* inconsistent redeclaration of static: %s */
+                       /* inconsistent redeclaration of static '%s' */
                        warning(92, dsym->s_name);
                        print_previous_declaration(-1, esym);
                }
diff -r 55b9fa49864f -r 96e962cbf6ce usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Tue Jun 21 16:24:37 2022 +0000
+++ b/usr.bin/xlint/lint1/err.c Tue Jun 21 21:18:30 2022 +0000
@@ -1,4 +1,4 @@



Home | Main Index | Thread Index | Old Index