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/c1ff013de067
branches:  trunk
changeset: 367254:c1ff013de067
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jun 19 12:14:33 2022 +0000

description:
lint: add quotes around placeholders in 4 messages

diffstat:

 tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c |   4 +-
 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c          |  76 +++++++++---------
 tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c   |   4 +-
 tests/usr.bin/xlint/lint1/d_c99_complex_split.c        |   4 +-
 tests/usr.bin/xlint/lint1/msg_033.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_045.c                    |   4 +-
 tests/usr.bin/xlint/lint1/msg_089.c                    |   8 +-
 tests/usr.bin/xlint/lint1/msg_102.c                    |   8 +-
 tests/usr.bin/xlint/lint1/msg_105.c                    |   4 +-
 tests/usr.bin/xlint/lint1/msg_107.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_121.c                    |   4 +-
 tests/usr.bin/xlint/lint1/msg_123.c                    |   6 +-
 tests/usr.bin/xlint/lint1/msg_132.c                    |   4 +-
 usr.bin/xlint/lint1/ckbool.c                           |   6 +-
 usr.bin/xlint/lint1/decl.c                             |   8 +-
 usr.bin/xlint/lint1/err.c                              |  12 +-
 usr.bin/xlint/lint1/tree.c                             |  10 +-
 17 files changed, 87 insertions(+), 87 deletions(-)

diffs (truncated from 589 to 300 lines):

diff -r 86598fc238c2 -r c1ff013de067 tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c
--- a/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c    Sun Jun 19 12:08:31 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/c99_bool_strict_suppressed.c    Sun Jun 19 12:14:33 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: c99_bool_strict_suppressed.c,v 1.4 2021/08/08 13:19:51 rillig Exp $    */
+/*     $NetBSD: c99_bool_strict_suppressed.c,v 1.5 2022/06/19 12:14:34 rillig Exp $    */
 # 3 "c99_bool_strict_suppressed.c"
 
 /*
@@ -29,7 +29,7 @@
        while (1)
                break;
 
-       /* suppressed+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* suppressed+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        b = i;
 
        /* suppressed+1: error: operand of '!' must be bool, not 'int' [330] */
diff -r 86598fc238c2 -r c1ff013de067 tests/usr.bin/xlint/lint1/d_c99_bool_strict.c
--- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Sun Jun 19 12:08:31 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict.c     Sun Jun 19 12:14:33 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_bool_strict.c,v 1.37 2022/02/27 08:31:26 rillig Exp $    */
+/*     $NetBSD: d_c99_bool_strict.c,v 1.38 2022/06/19 12:14:34 rillig Exp $    */
 # 3 "d_c99_bool_strict.c"
 
 /*
@@ -226,17 +226,17 @@
        bool b;
 
        b = flags.bool_flag;
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != unsigned int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'unsigned int' [107] */
        b = flags.uint_flag;
        flags.bool_flag = b;
-       /* expect+1: error: operands of '=' have incompatible types (unsigned int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'unsigned int' and '_Bool' [107] */
        flags.uint_flag = b;
 
        b = flags_ptr->bool_flag;
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != unsigned int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'unsigned int' [107] */
        b = flags_ptr->uint_flag;
        flags_ptr->bool_flag = b;
-       /* expect+1: error: operands of '=' have incompatible types (unsigned int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'unsigned int' and '_Bool' [107] */
        flags_ptr->uint_flag = b;
 }
 
@@ -373,23 +373,23 @@
        bool b;
        int i;
 
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        b = 0;
        b = __lint_false;
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        b = 1;
        b = __lint_true;
 
        i = 0;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = __lint_false;
        i = 1;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = __lint_true;
 
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = b;
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        b = i;
 }
 
@@ -402,13 +402,13 @@
        double d;
        void *p;
 
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = b;
-       /* expect+1: error: operands of '=' have incompatible types (unsigned int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'unsigned int' and '_Bool' [107] */
        u = b;
-       /* expect+1: error: operands of '=' have incompatible types (double != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'double' and '_Bool' [107] */
        d = b;
-       /* expect+1: error: operands of '=' have incompatible types (pointer != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'pointer' and '_Bool' [107] */
        p = b;
 }
 
@@ -554,14 +554,14 @@
        struct bool_struct bs = { __lint_true };
        b = bs.b;
        bs.b = b;
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        bs.b = 0;
 
        /* Access a struct member using the '->' operator. */
        struct bool_struct *bsp = &bs;
        b = bsp->b;
        bsp->b = b;
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        bsp->b = 0;
 }
 
@@ -722,9 +722,9 @@
        /* expect+1: error: right operand of '>>' must not be bool [337] */
        u = u >> b;
        u = b ? u : u;
-       /* expect+1: error: operands of ':' have incompatible types (_Bool != unsigned int) [107] */
+       /* expect+1: error: operands of ':' have incompatible types '_Bool' and 'unsigned int' [107] */
        u = b ? b : u;
-       /* expect+1: error: operands of ':' have incompatible types (unsigned int != _Bool) [107] */
+       /* expect+1: error: operands of ':' have incompatible types 'unsigned int' and '_Bool' [107] */
        u = b ? u : b;
 }
 
@@ -747,13 +747,13 @@
 void
 strict_bool_operator_result(bool b)
 {
-       /* expect+1: error: operands of 'init' have incompatible types (char != _Bool) [107] */
+       /* expect+1: error: operands of 'init' have incompatible types 'char' and '_Bool' [107] */
        char c = b;
-       /* expect+1: error: operands of 'init' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of 'init' have incompatible types 'int' and '_Bool' [107] */
        int i = b;
-       /* expect+1: error: operands of 'init' have incompatible types (double != _Bool) [107] */
+       /* expect+1: error: operands of 'init' have incompatible types 'double' and '_Bool' [107] */
        double d = b;
-       /* expect+1: error: operands of 'init' have incompatible types (pointer != _Bool) [107] */
+       /* expect+1: error: operands of 'init' have incompatible types 'pointer' and '_Bool' [107] */
        void *p = b;
 
        /* The right-hand sides of these assignments are all ok. */
@@ -771,23 +771,23 @@
         * The right-hand sides of these assignments are not ok, they
         * implicitly convert from bool to int.
         */
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = !b;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = i == i;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = i != i;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = i < i;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = i <= i;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = i >= i;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = i > i;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = b && b;
-       /* expect+1: error: operands of '=' have incompatible types (int != _Bool) [107] */
+       /* expect+1: error: operands of '=' have incompatible types 'int' and '_Bool' [107] */
        i = b || b;
 }
 
@@ -827,7 +827,7 @@
         * because it would be too confusing if FLAG0 would work and all the
         * other flags wouldn't.
         */
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        b = flags & FLAG0;
 
        /*
@@ -836,7 +836,7 @@
         * it as 2, as that is the integer value of FLAG1.  Since FLAG1 fits
         * in a uint8_t, no truncation takes place.
         */
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        b = flags & FLAG1;
 
        /*
@@ -844,7 +844,7 @@
         * zero.  In a uint8_t, the stored value would be 0 since bit 28 is
         * out of range for a uint8_t and thus gets truncated.
         */
-       /* expect+1: error: operands of '=' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '=' have incompatible types '_Bool' and 'int' [107] */
        b = flags & FLAG28;
 }
 
@@ -884,7 +884,7 @@
 void
 strict_bool_operator_eq_bool_int(void)
 {
-       /* expect+1: error: operands of '==' have incompatible types (_Bool != int) [107] */
+       /* expect+1: error: operands of '==' have incompatible types '_Bool' and 'int' [107] */
        (void)(strict_bool_conversion_return_false() == 0);
 }
 
@@ -940,9 +940,9 @@
        } var[] = {
            { __lint_false },
            { __lint_true },
-           /* expect+1: error: operands of 'init' have incompatible types (_Bool != int) [107] */
+           /* expect+1: error: operands of 'init' have incompatible types '_Bool' and 'int' [107] */
            { 0 },
-           /* expect+1: error: operands of 'init' have incompatible types (_Bool != int) [107] */
+           /* expect+1: error: operands of 'init' have incompatible types '_Bool' and 'int' [107] */
            { 1 },
        };
 }
diff -r 86598fc238c2 -r c1ff013de067 tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c
--- a/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c      Sun Jun 19 12:08:31 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_bool_strict_syshdr.c      Sun Jun 19 12:14:33 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_bool_strict_syshdr.c,v 1.16 2022/06/11 14:17:33 rillig Exp $     */
+/*     $NetBSD: d_c99_bool_strict_syshdr.c,v 1.17 2022/06/19 12:14:34 rillig Exp $     */
 # 3 "d_c99_bool_strict_syshdr.c"
 
 /*
@@ -78,7 +78,7 @@
            (int)((ctype_table + 1)[c] & 0x0040)        /* INT */
 # 80 "d_c99_bool_strict_syshdr.c"
        ;
-       /* expect-1: error: operands of 'init' have incompatible types (_Bool != int) [107] */
+       /* expect-1: error: operands of 'init' have incompatible types '_Bool' and 'int' [107] */
 
        int system_bool_assigned_to_int =
 # 85 "d_c99_bool_strict_syshdr.c" 3 4
diff -r 86598fc238c2 -r c1ff013de067 tests/usr.bin/xlint/lint1/d_c99_complex_split.c
--- a/tests/usr.bin/xlint/lint1/d_c99_complex_split.c   Sun Jun 19 12:08:31 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_complex_split.c   Sun Jun 19 12:14:33 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_c99_complex_split.c,v 1.9 2022/01/15 14:22:03 rillig Exp $   */
+/*     $NetBSD: d_c99_complex_split.c,v 1.10 2022/06/19 12:14:34 rillig Exp $  */
 # 3 "d_c99_complex_split.c"
 
 /*
@@ -79,7 +79,7 @@
 trigger_warning(double _Complex c)
 {
        c += 1.0;
-       /* expect+1: error: operands of '|' have incompatible types (double _Complex != double _Complex) [107] */
+       /* expect+1: error: operands of '|' have incompatible types 'double _Complex' and 'double _Complex' [107] */
        return c | c;
 }
 
diff -r 86598fc238c2 -r c1ff013de067 tests/usr.bin/xlint/lint1/msg_033.c
--- a/tests/usr.bin/xlint/lint1/msg_033.c       Sun Jun 19 12:08:31 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_033.c       Sun Jun 19 12:14:33 2022 +0000
@@ -1,13 +1,13 @@
-/*     $NetBSD: msg_033.c,v 1.3 2021/08/27 20:16:50 rillig Exp $       */
+/*     $NetBSD: msg_033.c,v 1.4 2022/06/19 12:14:34 rillig Exp $       */
 # 3 "msg_033.c"
 
-// Test for message: duplicate member name: %s [33]
+// Test for message: duplicate member name '%s' [33]
 
 /* lint1-extra-flags: -r */
 
 struct {
        /* Despite the option '-r', this location is not mentioned. */
        int member;
-       /* expect+1: error: duplicate member name: member [33] */
+       /* expect+1: error: duplicate member name 'member' [33] */
        double member;
 };
diff -r 86598fc238c2 -r c1ff013de067 tests/usr.bin/xlint/lint1/msg_045.c
--- a/tests/usr.bin/xlint/lint1/msg_045.c       Sun Jun 19 12:08:31 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_045.c       Sun Jun 19 12:14:33 2022 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_045.c,v 1.4 2022/06/11 11:52:13 rillig Exp $       */
+/*     $NetBSD: msg_045.c,v 1.5 2022/06/19 12:14:34 rillig Exp $       */
 # 3 "msg_045.c"
 
 /* Test for message: base type is really '%s %s' [45] */
@@ -16,6 +16,6 @@
        /* expect+2: error: 'counter' has incomplete type 'incomplete union counter' [31] */
        /* expect+1: warning: union 'counter' never defined [234] */
        union counter counter;
-       /* expect+1: warning: illegal member use: value [102] */
+       /* expect+1: warning: illegal use of member 'value' [102] */
        counter.value++;
 }
diff -r 86598fc238c2 -r c1ff013de067 tests/usr.bin/xlint/lint1/msg_089.c
--- a/tests/usr.bin/xlint/lint1/msg_089.c       Sun Jun 19 12:08:31 2022 +0000



Home | Main Index | Thread Index | Old Index