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: reword message about type mismatch...
details: https://anonhg.NetBSD.org/src/rev/8b7de4cee81a
branches: trunk
changeset: 981638:8b7de4cee81a
user: rillig <rillig%NetBSD.org@localhost>
date: Thu Mar 18 21:26:56 2021 +0000
description:
lint: reword message about type mismatch in initialization
Using parentheses for quotes is unusual, furthermore the previous
message didn't follow proper grammar rules, sacrificing clarity for
brevity.
diffstat:
tests/usr.bin/xlint/lint1/d_c99_init.exp | 2 +-
tests/usr.bin/xlint/lint1/d_struct_init_nested.exp | 4 ++--
tests/usr.bin/xlint/lint1/msg_185.c | 6 ++----
tests/usr.bin/xlint/lint1/msg_185.exp | 2 +-
usr.bin/xlint/lint1/err.c | 6 +++---
usr.bin/xlint/lint1/tree.c | 6 +++---
6 files changed, 12 insertions(+), 14 deletions(-)
diffs (98 lines):
diff -r b2f439910609 -r 8b7de4cee81a tests/usr.bin/xlint/lint1/d_c99_init.exp
--- a/tests/usr.bin/xlint/lint1/d_c99_init.exp Thu Mar 18 21:20:21 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_c99_init.exp Thu Mar 18 21:26:56 2021 +0000
@@ -1,4 +1,4 @@
d_c99_init.c(22): invalid initializer type int [176]
d_c99_init.c(23): too many initializers [174]
-d_c99_init.c(49): initialization type mismatch (pointer to const void) and (struct any) [185]
+d_c99_init.c(49): cannot initialize 'pointer to const void' from 'struct any' [185]
d_c99_init.c(66): too many array initializers, expected 3 [173]
diff -r b2f439910609 -r 8b7de4cee81a tests/usr.bin/xlint/lint1/d_struct_init_nested.exp
--- a/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp Thu Mar 18 21:20:21 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/d_struct_init_nested.exp Thu Mar 18 21:26:56 2021 +0000
@@ -1,4 +1,4 @@
-d_struct_init_nested.c(35): initialization type mismatch (enum I1) and (struct Inner1) [185]
+d_struct_init_nested.c(35): cannot initialize 'enum I1' from 'struct Inner1' [185]
d_struct_init_nested.c(37): too many struct/union initializers [172]
-d_struct_init_nested.c(62): initialization type mismatch (enum I1) and (struct Inner2) [185]
+d_struct_init_nested.c(62): cannot initialize 'enum I1' from 'struct Inner2' [185]
d_struct_init_nested.c(64): warning: enum type mismatch between 'enum I2' and 'enum O3' in initialization [210]
diff -r b2f439910609 -r 8b7de4cee81a tests/usr.bin/xlint/lint1/msg_185.c
--- a/tests/usr.bin/xlint/lint1/msg_185.c Thu Mar 18 21:20:21 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_185.c Thu Mar 18 21:26:56 2021 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_185.c,v 1.4 2021/03/18 21:20:21 rillig Exp $ */
+/* $NetBSD: msg_185.c,v 1.5 2021/03/18 21:26:56 rillig Exp $ */
# 3 "msg_185.c"
-// Test for message: initialization type mismatch (%s) and (%s) [185]
+// Test for message: cannot initialize '%s' from '%s' [185]
typedef struct any {
const void *value;
@@ -15,5 +15,3 @@
any local = { 3.0 }; /* expect: 185 */
use(&arg);
}
-
-// TODO: message 185 needs to be reworded to "cannot initialize '%s' from '%s'".
diff -r b2f439910609 -r 8b7de4cee81a tests/usr.bin/xlint/lint1/msg_185.exp
--- a/tests/usr.bin/xlint/lint1/msg_185.exp Thu Mar 18 21:20:21 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_185.exp Thu Mar 18 21:26:56 2021 +0000
@@ -1,1 +1,1 @@
-msg_185.c(15): initialization type mismatch (pointer to const void) and (double) [185]
+msg_185.c(15): cannot initialize 'pointer to const void' from 'double' [185]
diff -r b2f439910609 -r 8b7de4cee81a usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Thu Mar 18 21:20:21 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Thu Mar 18 21:26:56 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.87 2021/03/07 19:42:54 rillig Exp $ */
+/* $NetBSD: err.c,v 1.88 2021/03/18 21:26:56 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.87 2021/03/07 19:42:54 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.88 2021/03/18 21:26:56 rillig Exp $");
#endif
#include <sys/types.h>
@@ -244,7 +244,7 @@
"incompatible pointer types (%s != %s)", /* 182 */
"illegal combination of %s (%s) and %s (%s)", /* 183 */
"illegal pointer combination", /* 184 */
- "initialization type mismatch (%s) and (%s)", /* 185 */
+ "cannot initialize '%s' from '%s'", /* 185 */
"bit-field initialization is illegal in traditional C", /* 186 */
"non-null byte ignored in string initializer", /* 187 */
"no automatic aggregate initialization in traditional C", /* 188 */
diff -r b2f439910609 -r 8b7de4cee81a usr.bin/xlint/lint1/tree.c
--- a/usr.bin/xlint/lint1/tree.c Thu Mar 18 21:20:21 2021 +0000
+++ b/usr.bin/xlint/lint1/tree.c Thu Mar 18 21:26:56 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: tree.c,v 1.233 2021/03/17 01:15:31 rillig Exp $ */
+/* $NetBSD: tree.c,v 1.234 2021/03/18 21:26:56 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.233 2021/03/17 01:15:31 rillig Exp $");
+__RCSID("$NetBSD: tree.c,v 1.234 2021/03/18 21:26:56 rillig Exp $");
#endif
#include <float.h>
@@ -1661,7 +1661,7 @@
switch (op) {
case INIT:
- /* initialization type mismatch (%s) and (%s) */
+ /* cannot initialize '%s' from '%s' */
error(185, type_name(ltp), type_name(rtp));
break;
case RETURN:
Home |
Main Index |
Thread Index |
Old Index