Module Name:    src
Committed By:   rillig
Date:           Sun Feb 28 02:00:06 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: msg_245.c msg_245.exp
        src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: add type information for 'incompatible struct pointers'


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_245.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_245.exp
cvs rdiff -u -r1.84 -r1.85 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.224 -r1.225 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/msg_245.c
diff -u src/tests/usr.bin/xlint/lint1/msg_245.c:1.3 src/tests/usr.bin/xlint/lint1/msg_245.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_245.c:1.3	Sun Feb 28 01:53:49 2021
+++ src/tests/usr.bin/xlint/lint1/msg_245.c	Sun Feb 28 02:00:06 2021
@@ -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;

Index: src/tests/usr.bin/xlint/lint1/msg_245.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_245.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_245.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_245.exp:1.2	Sun Feb 28 01:53:49 2021
+++ src/tests/usr.bin/xlint/lint1/msg_245.exp	Sun Feb 28 02:00:06 2021
@@ -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]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.84 src/usr.bin/xlint/lint1/err.c:1.85
--- src/usr.bin/xlint/lint1/err.c:1.84	Sun Feb 28 01:30:22 2021
+++ src/usr.bin/xlint/lint1/err.c	Sun Feb 28 02:00:05 2021
@@ -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 @@ const	char *msgs[] = {
 	"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 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.224 src/usr.bin/xlint/lint1/tree.c:1.225
--- src/usr.bin/xlint/lint1/tree.c:1.224	Sun Feb 28 01:30:22 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sun Feb 28 02:00:05 2021
@@ -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 @@ warn_incompatible_pointers(const mod_t *
 			/* 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) {

Reply via email to