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 type information to message 12...



details:   https://anonhg.NetBSD.org/src/rev/67627a88b000
branches:  trunk
changeset: 1017652:67627a88b000
user:      rillig <rillig%NetBSD.org@localhost>
date:      Sun Jan 03 15:51:16 2021 +0000

description:
lint: add type information to message 124 "illegal pointer combination"

diffstat:

 tests/usr.bin/xlint/lint1/d_long_double_int.exp |  2 +-
 tests/usr.bin/xlint/lint1/msg_124.exp           |  6 +++---
 usr.bin/xlint/lint1/err.c                       |  6 +++---
 usr.bin/xlint/lint1/tree.c                      |  9 +++++----
 4 files changed, 12 insertions(+), 11 deletions(-)

diffs (73 lines):

diff -r e0498f93f55a -r 67627a88b000 tests/usr.bin/xlint/lint1/d_long_double_int.exp
--- a/tests/usr.bin/xlint/lint1/d_long_double_int.exp   Sun Jan 03 15:44:35 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_long_double_int.exp   Sun Jan 03 15:51:16 2021 +0000
@@ -1,1 +1,1 @@
-(9): warning: illegal pointer combination, op p == p [124]
+(9): warning: illegal pointer combination (pointer to long double) and (pointer to long), op p == p [124]
diff -r e0498f93f55a -r 67627a88b000 tests/usr.bin/xlint/lint1/msg_124.exp
--- a/tests/usr.bin/xlint/lint1/msg_124.exp     Sun Jan 03 15:44:35 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_124.exp     Sun Jan 03 15:51:16 2021 +0000
@@ -1,3 +1,3 @@
-msg_124.c(16): warning: illegal pointer combination, op p = p [124]
-msg_124.c(17): warning: illegal pointer combination, op p = p [124]
-msg_124.c(18): warning: illegal pointer combination, op p = p [124]
+msg_124.c(16): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
+msg_124.c(17): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
+msg_124.c(18): warning: illegal pointer combination (pointer to function) and (pointer to int), op p = p [124]
diff -r e0498f93f55a -r 67627a88b000 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Jan 03 15:44:35 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Jan 03 15:51:16 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: err.c,v 1.60 2021/01/02 17:17:00 rillig Exp $  */
+/*     $NetBSD: err.c,v 1.61 2021/01/03 15:51:16 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.60 2021/01/02 17:17:00 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.61 2021/01/03 15:51:16 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -183,7 +183,7 @@
        "negative shift",                                             /* 121 */
        "shift greater than size of object",                          /* 122 */
        "illegal combination of %s (%s) and %s (%s), op %s",          /* 123 */
-       "illegal pointer combination, op %s",                         /* 124 */
+       "illegal pointer combination (%s) and (%s), op %s",           /* 124 */
        "ANSI C forbids ordered comparisons of pointers to functions",/* 125 */
        "incompatible types in conditional",                          /* 126 */
        "'&' before array or function: ignored",                      /* 127 */
diff -r e0498f93f55a -r 67627a88b000 usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c        Sun Jan 03 15:44:35 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c        Sun Jan 03 15:51:16 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tree.c,v 1.116 2021/01/02 18:26:44 rillig Exp $        */
+/*     $NetBSD: tree.c,v 1.117 2021/01/03 15:51:16 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.116 2021/01/02 18:26:44 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.117 2021/01/03 15:51:16 rillig Exp $");
 #endif
 
 #include <float.h>
@@ -2215,8 +2215,9 @@
                        /* illegal pointer combination */
                        warning(184);
                } else {
-                       /* illegal pointer combination, op %s */
-                       warning(124, mp->m_name);
+                       /* illegal pointer combination (%s) and (%s), op %s */
+                       warning(124,
+                           type_name(ltp), type_name(rtp), mp->m_name);
                }
        }
 }



Home | Main Index | Thread Index | Old Index