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: use standard quoting style for mes...



details:   https://anonhg.NetBSD.org/src/rev/1d72bb8f01f4
branches:  trunk
changeset: 1022907:1d72bb8f01f4
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sat Aug 14 13:00:55 2021 +0000

description:
lint: use standard quoting style for messages 124 and 184

diffstat:

 tests/usr.bin/xlint/lint1/d_init_array_using_string.c   |  14 +++++++++-----
 tests/usr.bin/xlint/lint1/d_init_array_using_string.exp |  16 ++++++++--------
 tests/usr.bin/xlint/lint1/d_long_double_int.exp         |   2 +-
 tests/usr.bin/xlint/lint1/msg_124.c                     |   4 ++--
 tests/usr.bin/xlint/lint1/msg_124.exp                   |  10 +++++-----
 tests/usr.bin/xlint/lint1/msg_184.c                     |   7 ++++---
 tests/usr.bin/xlint/lint1/msg_184.exp                   |   2 +-
 usr.bin/xlint/lint1/err.c                               |   8 ++++----
 usr.bin/xlint/lint1/tree.c                              |  10 +++++-----
 9 files changed, 39 insertions(+), 34 deletions(-)

diffs (181 lines):

diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 tests/usr.bin/xlint/lint1/d_init_array_using_string.c
--- a/tests/usr.bin/xlint/lint1/d_init_array_using_string.c     Sat Aug 14 12:46:23 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_init_array_using_string.c     Sat Aug 14 13:00:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: d_init_array_using_string.c,v 1.4 2021/04/09 23:03:26 rillig Exp $     */
+/*     $NetBSD: d_init_array_using_string.c,v 1.5 2021/08/14 13:00:55 rillig Exp $     */
 # 3 "d_init_array_using_string.c"
 
 /*
@@ -13,8 +13,10 @@
        const char *cs_match = "";
        const int *ws_match = L"";
 
-       const char *cs_mismatch = L"";  /* expect: illegal pointer combination */
-       const int *ws_mismatch = "";    /* expect: illegal pointer combination */
+       /* expect+1: warning: illegal combination of 'pointer to const char' and 'pointer to int', op 'init' [124] */
+       const char *cs_mismatch = L"";
+       /* expect+1: warning: illegal combination of 'pointer to const int' and 'pointer to char', op 'init' [124] */
+       const int *ws_mismatch = "";
 }
 
 void
@@ -31,8 +33,10 @@
        };
 
        struct cs_ws type_mismatch = {
-               L"",            /* expect: illegal pointer combination */
-               "",             /* expect: illegal pointer combination */
+               /* expect+1: warning: illegal combination of 'pointer to const char' and 'pointer to int', op 'init' [124] */
+               L"",
+               /* expect+1: warning: illegal combination of 'pointer to const int' and 'pointer to char', op 'init' [124] */
+               "",
        };
 
        struct cs_ws extra_braces = {
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 tests/usr.bin/xlint/lint1/d_init_array_using_string.exp
--- a/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp   Sat Aug 14 12:46:23 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp   Sat Aug 14 13:00:55 2021 +0000
@@ -1,8 +1,8 @@
-d_init_array_using_string.c(16): warning: illegal pointer combination (pointer to const char) and (pointer to int), op init [124]
-d_init_array_using_string.c(17): warning: illegal pointer combination (pointer to const int) and (pointer to char), op init [124]
-d_init_array_using_string.c(34): warning: illegal pointer combination (pointer to const char) and (pointer to int), op init [124]
-d_init_array_using_string.c(35): warning: illegal pointer combination (pointer to const int) and (pointer to char), op init [124]
-d_init_array_using_string.c(59): error: cannot initialize 'array[10] of const char' from 'pointer to int' [185]
-d_init_array_using_string.c(60): error: cannot initialize 'array[10] of const int' from 'pointer to char' [185]
-d_init_array_using_string.c(69): warning: non-null byte ignored in string initializer [187]
-d_init_array_using_string.c(70): warning: non-null byte ignored in string initializer [187]
+d_init_array_using_string.c(17): warning: illegal combination of 'pointer to const char' and 'pointer to int', op 'init' [124]
+d_init_array_using_string.c(19): warning: illegal combination of 'pointer to const int' and 'pointer to char', op 'init' [124]
+d_init_array_using_string.c(37): warning: illegal combination of 'pointer to const char' and 'pointer to int', op 'init' [124]
+d_init_array_using_string.c(39): warning: illegal combination of 'pointer to const int' and 'pointer to char', op 'init' [124]
+d_init_array_using_string.c(63): error: cannot initialize 'array[10] of const char' from 'pointer to int' [185]
+d_init_array_using_string.c(64): error: cannot initialize 'array[10] of const int' from 'pointer to char' [185]
+d_init_array_using_string.c(73): warning: non-null byte ignored in string initializer [187]
+d_init_array_using_string.c(74): warning: non-null byte ignored in string initializer [187]
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 tests/usr.bin/xlint/lint1/d_long_double_int.exp
--- a/tests/usr.bin/xlint/lint1/d_long_double_int.exp   Sat Aug 14 12:46:23 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_long_double_int.exp   Sat Aug 14 13:00:55 2021 +0000
@@ -1,1 +1,1 @@
-d_long_double_int.c(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op == [124]
+d_long_double_int.c(9): warning: illegal combination of 'pointer to long double' and 'pointer to long', op '==' [124]
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 tests/usr.bin/xlint/lint1/msg_124.c
--- a/tests/usr.bin/xlint/lint1/msg_124.c       Sat Aug 14 12:46:23 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_124.c       Sat Aug 14 13:00:55 2021 +0000
@@ -1,7 +1,7 @@
-/*     $NetBSD: msg_124.c,v 1.10 2021/07/10 06:01:41 rillig Exp $      */
+/*     $NetBSD: msg_124.c,v 1.11 2021/08/14 13:00:55 rillig Exp $      */
 # 3 "msg_124.c"
 
-// Test for message: illegal pointer combination (%s) and (%s), op %s [124]
+// Test for message: illegal combination of '%s' and '%s', op '%s' [124]
 
 /* lint1-extra-flags: -s */
 
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 tests/usr.bin/xlint/lint1/msg_124.exp
--- a/tests/usr.bin/xlint/lint1/msg_124.exp     Sat Aug 14 12:46:23 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_124.exp     Sat Aug 14 13:00:55 2021 +0000
@@ -1,6 +1,6 @@
-msg_124.c(18): warning: illegal pointer combination (pointer to function(int) returning void) and (pointer to int), op init [124]
-msg_124.c(19): warning: illegal pointer combination (pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void) and (pointer to int), op init 
[124]
-msg_124.c(20): warning: illegal pointer combination (pointer to function(pointer to const char, ...) returning int) and (pointer to int), op init [124]
+msg_124.c(18): warning: illegal combination of 'pointer to function(int) returning void' and 'pointer to int', op 'init' [124]
+msg_124.c(19): warning: illegal combination of 'pointer to function(pointer to function(int) returning void) returning pointer to function(int) returning void' and 'pointer to int', op 'init' [124]
+msg_124.c(20): warning: illegal combination of 'pointer to function(pointer to const char, ...) returning int' and 'pointer to int', op 'init' [124]
 msg_124.c(32): warning: ANSI C forbids comparison of 'void *' with function pointer [274]
-msg_124.c(33): warning: illegal pointer combination (pointer to const char) and (pointer to const int), op == [124]
-msg_124.c(34): warning: illegal pointer combination (pointer to const char) and (pointer to function(int) returning void), op == [124]
+msg_124.c(33): warning: illegal combination of 'pointer to const char' and 'pointer to const int', op '==' [124]
+msg_124.c(34): warning: illegal combination of 'pointer to const char' and 'pointer to function(int) returning void', op '==' [124]
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 tests/usr.bin/xlint/lint1/msg_184.c
--- a/tests/usr.bin/xlint/lint1/msg_184.c       Sat Aug 14 12:46:23 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_184.c       Sat Aug 14 13:00:55 2021 +0000
@@ -1,10 +1,11 @@
-/*     $NetBSD: msg_184.c,v 1.3 2021/03/19 08:01:58 rillig Exp $       */
+/*     $NetBSD: msg_184.c,v 1.4 2021/08/14 13:00:55 rillig Exp $       */
 # 3 "msg_184.c"
 
-// Test for message: illegal pointer combination [184]
+// Test for message: illegal combination of '%s' and '%s' [184]
 
 int *
 example(char *cp)
 {
-       return cp;              /* expect: 184 */
+       /* expect+1: illegal combination of 'pointer to int' and 'pointer to char' [184] */
+       return cp;
 }
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 tests/usr.bin/xlint/lint1/msg_184.exp
--- a/tests/usr.bin/xlint/lint1/msg_184.exp     Sat Aug 14 12:46:23 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_184.exp     Sat Aug 14 13:00:55 2021 +0000
@@ -1,1 +1,1 @@
-msg_184.c(9): warning: illegal pointer combination [184]
+msg_184.c(10): warning: illegal combination of 'pointer to int' and 'pointer to char' [184]
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sat Aug 14 12:46:23 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sat Aug 14 13:00:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.135 2021/08/09 20:07:23 rillig Exp $ */
+/*     $NetBSD: err.c,v 1.136 2021/08/14 13:00:55 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.135 2021/08/09 20:07:23 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.136 2021/08/14 13:00:55 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -178,7 +178,7 @@
        "negative shift",                                             /* 121 */
        "shift amount %llu is greater than bit-size %llu of '%s'",    /* 122 */
        "illegal combination of %s (%s) and %s (%s), op %s",          /* 123 */
-       "illegal pointer combination (%s) and (%s), op %s",           /* 124 */
+       "illegal combination of '%s' and '%s', op '%s'",              /* 124 */
        "ANSI C forbids ordered comparisons of pointers to functions",/* 125 */
        "incompatible types '%s' and '%s' in conditional",            /* 126 */
        "'&' before array or function: ignored",                      /* 127 */
@@ -238,7 +238,7 @@
        "{}-enclosed initializer required",                           /* 181 */
        "incompatible pointer types (%s != %s)",                      /* 182 */
        "illegal combination of %s (%s) and %s (%s)",                 /* 183 */
-       "illegal pointer combination",                                /* 184 */
+       "illegal combination of '%s' and '%s'",                       /* 184 */
        "cannot initialize '%s' from '%s'",                           /* 185 */
        "bit-field initialization is illegal in traditional C",       /* 186 */
        "non-null byte ignored in string initializer",                /* 187 */
diff -r dc6e5c25a2a7 -r 1d72bb8f01f4 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sat Aug 14 12:46:23 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sat Aug 14 13:00:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.333 2021/08/14 12:46:23 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.334 2021/08/14 13:00:55 rillig Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tree.c,v 1.333 2021/08/14 12:46:23 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.334 2021/08/14 13:00:55 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2528,10 +2528,10 @@
                }
        } else {
                if (mp == NULL) {
-                       /* illegal pointer combination */
-                       warning(184);
+                       /* illegal combination of '%s' and '%s' */
+                       warning(184, type_name(ltp), type_name(rtp));
                } else {
-                       /* illegal pointer combination (%s) and (%s), op %s */
+                       /* illegal combination of '%s' and '%s', op '%s' */
                        warning(124,
                            type_name(ltp), type_name(rtp), mp->m_name);
                }



Home | Main Index | Thread Index | Old Index