Module Name:    src
Committed By:   rillig
Date:           Sat Aug 14 13:00:55 UTC 2021

Modified Files:
        src/tests/usr.bin/xlint/lint1: d_init_array_using_string.c
            d_init_array_using_string.exp d_long_double_int.exp msg_124.c
            msg_124.exp msg_184.c msg_184.exp
        src/usr.bin/xlint/lint1: err.c tree.c

Log Message:
lint: use standard quoting style for messages 124 and 184


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 \
    src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c \
    src/tests/usr.bin/xlint/lint1/d_long_double_int.exp
cvs rdiff -u -r1.5 -r1.6 \
    src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp
cvs rdiff -u -r1.10 -r1.11 src/tests/usr.bin/xlint/lint1/msg_124.c \
    src/tests/usr.bin/xlint/lint1/msg_124.exp
cvs rdiff -u -r1.3 -r1.4 src/tests/usr.bin/xlint/lint1/msg_184.c
cvs rdiff -u -r1.2 -r1.3 src/tests/usr.bin/xlint/lint1/msg_184.exp
cvs rdiff -u -r1.135 -r1.136 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.333 -r1.334 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_init_array_using_string.c
diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.4 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.5
--- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c:1.4	Fri Apr  9 23:03:26 2021
+++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.c	Sat Aug 14 13:00:55 2021
@@ -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 @@ test_assignment_initialization(void)
 	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 @@ test_pointer_initialization_in_struct(vo
 	};
 
 	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 = {
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.4 src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.5
--- src/tests/usr.bin/xlint/lint1/d_long_double_int.exp:1.4	Sun Jan 31 14:39:31 2021
+++ src/tests/usr.bin/xlint/lint1/d_long_double_int.exp	Sat Aug 14 13:00:55 2021
@@ -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]

Index: src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp
diff -u src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.5 src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.6
--- src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp:1.5	Sat Aug 14 12:46:24 2021
+++ src/tests/usr.bin/xlint/lint1/d_init_array_using_string.exp	Sat Aug 14 13:00:55 2021
@@ -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]

Index: src/tests/usr.bin/xlint/lint1/msg_124.c
diff -u src/tests/usr.bin/xlint/lint1/msg_124.c:1.10 src/tests/usr.bin/xlint/lint1/msg_124.c:1.11
--- src/tests/usr.bin/xlint/lint1/msg_124.c:1.10	Sat Jul 10 06:01:41 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.c	Sat Aug 14 13:00:55 2021
@@ -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 */
 
Index: src/tests/usr.bin/xlint/lint1/msg_124.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_124.exp:1.10 src/tests/usr.bin/xlint/lint1/msg_124.exp:1.11
--- src/tests/usr.bin/xlint/lint1/msg_124.exp:1.10	Sat Aug 14 12:46:24 2021
+++ src/tests/usr.bin/xlint/lint1/msg_124.exp	Sat Aug 14 13:00:55 2021
@@ -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]

Index: src/tests/usr.bin/xlint/lint1/msg_184.c
diff -u src/tests/usr.bin/xlint/lint1/msg_184.c:1.3 src/tests/usr.bin/xlint/lint1/msg_184.c:1.4
--- src/tests/usr.bin/xlint/lint1/msg_184.c:1.3	Fri Mar 19 08:01:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_184.c	Sat Aug 14 13:00:55 2021
@@ -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;
 }

Index: src/tests/usr.bin/xlint/lint1/msg_184.exp
diff -u src/tests/usr.bin/xlint/lint1/msg_184.exp:1.2 src/tests/usr.bin/xlint/lint1/msg_184.exp:1.3
--- src/tests/usr.bin/xlint/lint1/msg_184.exp:1.2	Fri Mar 19 08:01:58 2021
+++ src/tests/usr.bin/xlint/lint1/msg_184.exp	Sat Aug 14 13:00:55 2021
@@ -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]

Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.135 src/usr.bin/xlint/lint1/err.c:1.136
--- src/usr.bin/xlint/lint1/err.c:1.135	Mon Aug  9 20:07:23 2021
+++ src/usr.bin/xlint/lint1/err.c	Sat Aug 14 13:00:55 2021
@@ -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 @@ const char *const msgs[] = {
 	"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 @@ const char *const msgs[] = {
 	"{}-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 */

Index: src/usr.bin/xlint/lint1/tree.c
diff -u src/usr.bin/xlint/lint1/tree.c:1.333 src/usr.bin/xlint/lint1/tree.c:1.334
--- src/usr.bin/xlint/lint1/tree.c:1.333	Sat Aug 14 12:46:23 2021
+++ src/usr.bin/xlint/lint1/tree.c	Sat Aug 14 13:00:55 2021
@@ -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 @@ warn_incompatible_pointers(const mod_t *
 		}
 	} 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);
 		}

Reply via email to