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 for 'incompat...
details: https://anonhg.NetBSD.org/src/rev/063c48f1d66d
branches: trunk
changeset: 959886:063c48f1d66d
user: rillig <rillig%NetBSD.org@localhost>
date: Sun Feb 28 02:00:05 2021 +0000
description:
lint: add type information for 'incompatible struct pointers'
diffstat:
tests/usr.bin/xlint/lint1/msg_245.c | 4 ++--
tests/usr.bin/xlint/lint1/msg_245.exp | 6 +++---
usr.bin/xlint/lint1/err.c | 6 +++---
usr.bin/xlint/lint1/tree.c | 8 ++++----
4 files changed, 12 insertions(+), 12 deletions(-)
diffs (79 lines):
diff -r f5031be7e0a8 -r 063c48f1d66d tests/usr.bin/xlint/lint1/msg_245.c
--- a/tests/usr.bin/xlint/lint1/msg_245.c Sun Feb 28 01:53:49 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_245.c Sun Feb 28 02:00:05 2021 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_245.c,v 1.3 2021/02/28 01:53:49 rillig Exp $ */
+/* $NetBSD: msg_245.c,v 1.4 2021/02/28 02:00:06 rillig Exp $ */
# 3 "msg_245.c"
-// Test for message: illegal structure pointer combination, op %s [245]
+// Test for message: incompatible structure pointers: '%s' '%s' '%s' [245]
typedef struct tag_and_typedef_tag {
int member;
diff -r f5031be7e0a8 -r 063c48f1d66d tests/usr.bin/xlint/lint1/msg_245.exp
--- a/tests/usr.bin/xlint/lint1/msg_245.exp Sun Feb 28 01:53:49 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_245.exp Sun Feb 28 02:00:05 2021 +0000
@@ -1,3 +1,3 @@
-msg_245.c(29): warning: illegal structure pointer combination, op == [245]
-msg_245.c(30): warning: illegal structure pointer combination, op == [245]
-msg_245.c(31): warning: illegal structure pointer combination, op == [245]
+msg_245.c(29): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct only_tag' [245]
+msg_245.c(30): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct <unnamed>' [245]
+msg_245.c(31): warning: incompatible structure pointers: 'pointer to struct tag_and_typedef_tag' '==' 'pointer to struct <unnamed>' [245]
diff -r f5031be7e0a8 -r 063c48f1d66d usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Sun Feb 28 01:53:49 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Sun Feb 28 02:00:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.84 2021/02/28 01:30:22 rillig Exp $ */
+/* $NetBSD: err.c,v 1.85 2021/02/28 02:00:05 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.84 2021/02/28 01:30:22 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.85 2021/02/28 02:00:05 rillig Exp $");
#endif
#include <sys/types.h>
@@ -304,7 +304,7 @@
"combination of '%s' and '%s', op %s", /* 242 */
"dubious comparison of enums, op %s", /* 243 */
"illegal structure pointer combination", /* 244 */
- "illegal structure pointer combination, op %s", /* 245 */
+ "incompatible structure pointers: '%s' '%s' '%s'", /* 245 */
"dubious conversion of enum to '%s'", /* 246 */
"pointer cast from '%s' to '%s' may be troublesome", /* 247 */
"floating-point constant out of range", /* 248 */
diff -r f5031be7e0a8 -r 063c48f1d66d usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Sun Feb 28 01:53:49 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Sun Feb 28 02:00:05 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.224 2021/02/28 01:30:22 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.225 2021/02/28 02:00:05 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.224 2021/02/28 01:30:22 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.225 2021/02/28 02:00:05 rillig Exp $");
#endif
#include <float.h>
@@ -2567,8 +2567,8 @@
/* illegal structure pointer combination */
warning(244);
} else {
- /* illegal structure pointer combination, op %s */
- warning(245, mp->m_name);
+ /* incompatible structure pointers: '%s' '%s' '%s' */
+ warning(245, type_name(ltp), mp->m_name, type_name(rtp));
}
} else {
if (mp == NULL) {
Home |
Main Index |
Thread Index |
Old Index