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 to message 175
details: https://anonhg.NetBSD.org/src/rev/d46bef52e379
branches: trunk
changeset: 954162:d46bef52e379
user: rillig <rillig%NetBSD.org@localhost>
date: Tue Mar 30 15:07:53 2021 +0000
description:
lint: add type information to message 175
diffstat:
tests/usr.bin/xlint/lint1/msg_175.c | 4 ++--
tests/usr.bin/xlint/lint1/msg_175.exp | 2 +-
usr.bin/xlint/lint1/err.c | 6 +++---
usr.bin/xlint/lint1/init.c | 9 ++++-----
4 files changed, 10 insertions(+), 11 deletions(-)
diffs (78 lines):
diff -r aa2b2b6b776e -r d46bef52e379 tests/usr.bin/xlint/lint1/msg_175.c
--- a/tests/usr.bin/xlint/lint1/msg_175.c Tue Mar 30 15:05:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_175.c Tue Mar 30 15:07:53 2021 +0000
@@ -1,7 +1,7 @@
-/* $NetBSD: msg_175.c,v 1.3 2021/02/22 15:09:50 rillig Exp $ */
+/* $NetBSD: msg_175.c,v 1.4 2021/03/30 15:07:53 rillig Exp $ */
# 3 "msg_175.c"
-// Test for message: initialization of an incomplete type [175]
+// Test for message: initialization of incomplete type '%s' [175]
struct incomplete; /* expect: 233 */
diff -r aa2b2b6b776e -r d46bef52e379 tests/usr.bin/xlint/lint1/msg_175.exp
--- a/tests/usr.bin/xlint/lint1/msg_175.exp Tue Mar 30 15:05:05 2021 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_175.exp Tue Mar 30 15:07:53 2021 +0000
@@ -1,3 +1,3 @@
-msg_175.c(8): error: initialization of an incomplete type [175]
+msg_175.c(8): error: initialization of incomplete type 'struct incomplete' [175]
msg_175.c(10): error: incomplete structure or union incomplete: incomplete [31]
msg_175.c(6): warning: struct incomplete never defined [233]
diff -r aa2b2b6b776e -r d46bef52e379 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Tue Mar 30 15:05:05 2021 +0000
+++ b/usr.bin/xlint/lint1/err.c Tue Mar 30 15:07:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.97 2021/03/28 14:01:49 rillig Exp $ */
+/* $NetBSD: err.c,v 1.98 2021/03/30 15:07:53 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.97 2021/03/28 14:01:49 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.98 2021/03/30 15:07:53 rillig Exp $");
#endif
#include <sys/types.h>
@@ -229,7 +229,7 @@
"too many struct/union initializers", /* 172 */
"too many array initializers, expected %d", /* 173 */
"too many initializers", /* 174 */
- "initialization of an incomplete type", /* 175 */
+ "initialization of incomplete type '%s'", /* 175 */
"", /* no longer used */ /* 176 */
"non-constant initializer", /* 177 */
"initializer does not fit", /* 178 */
diff -r aa2b2b6b776e -r d46bef52e379 usr.bin/xlint/lint1/init.c
--- a/usr.bin/xlint/lint1/init.c Tue Mar 30 15:05:05 2021 +0000
+++ b/usr.bin/xlint/lint1/init.c Tue Mar 30 15:07:53 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: init.c,v 1.179 2021/03/30 14:25:28 rillig Exp $ */
+/* $NetBSD: init.c,v 1.180 2021/03/30 15:07:53 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: init.c,v 1.179 2021/03/30 14:25:28 rillig Exp $");
+__RCSID("$NetBSD: init.c,v 1.180 2021/03/30 15:07:53 rillig Exp $");
#endif
#include <stdlib.h>
@@ -802,9 +802,8 @@
}
if (tp->t_tspec == STRUCT && tp->t_str->sou_incomplete) {
- /* TODO: add type information */
- /* initialization of an incomplete type */
- error(175);
+ /* initialization of incomplete type '%s' */
+ error(175, type_name(tp));
in->in_err = true;
goto done;
}
Home |
Main Index |
Thread Index |
Old Index