Module Name: src
Committed By: rillig
Date: Sun Jan 3 15:51:16 UTC 2021
Modified Files:
src/tests/usr.bin/xlint/lint1: d_long_double_int.exp msg_124.exp
src/usr.bin/xlint/lint1: err.c tree.c
Log Message:
lint: add type information to message 124 "illegal pointer combination"
To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.60 -r1.61 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.116 -r1.117 src/usr.bin/xlint/lint1/tree.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
diff -u src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.1 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.2
--- src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.1 Mon Dec 28 09:58:56 2020
+++ src/tests/usr.bin/xlint/lint1/d_long_double_int.exp Sun Jan 3 15:51:16 2021
@@ -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]
Index: src/tests/usr.bin/xlint/lint1/msg_124.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_124.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_124.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_124.exp:1.2 Sun Jan 3 15:44:35 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.exp Sun Jan 3 15:51:16 2021
@@ -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]
Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.60 src/usr.bin/xlint/lint1/err.c:1.61
--- src/usr.bin/xlint/lint1/err.c:1.60 Sat Jan 2 17:17:00 2021
+++ src/usr.bin/xlint/lint1/err.c Sun Jan 3 15:51:16 2021
@@ -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 @@ const char *msgs[] = {
"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 */
Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.116 src/usr.bin/xlint/lint1/tree.c:1.117
--- src/usr.bin/xlint/lint1/tree.c:1.116 Sat Jan 2 18:26:44 2021
+++ src/usr.bin/xlint/lint1/tree.c Sun Jan 3 15:51:16 2021
@@ -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 @@ warn_incompatible_pointers(mod_t *mp, ty
/* 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);
}
}
}