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 details to message about illeg...
details: https://anonhg.NetBSD.org/src/rev/fcc790240901
branches: trunk
changeset: 364635:fcc790240901
user: rillig <rillig%NetBSD.org@localhost>
date: Fri Apr 01 22:07:23 2022 +0000
description:
lint: add details to message about illegal return type
diffstat:
tests/usr.bin/xlint/lint1/msg_015.c | 6 +++---
tests/usr.bin/xlint/lint1/msg_015.exp | 2 +-
usr.bin/xlint/lint1/decl.c | 8 ++++----
usr.bin/xlint/lint1/err.c | 6 +++---
4 files changed, 11 insertions(+), 11 deletions(-)
diffs (78 lines):
diff -r bc44962df411 -r fcc790240901 tests/usr.bin/xlint/lint1/msg_015.c
--- a/tests/usr.bin/xlint/lint1/msg_015.c Fri Apr 01 21:53:35 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_015.c Fri Apr 01 22:07:23 2022 +0000
@@ -1,9 +1,9 @@
-/* $NetBSD: msg_015.c,v 1.3 2021/08/26 19:23:25 rillig Exp $ */
+/* $NetBSD: msg_015.c,v 1.4 2022/04/01 22:07:23 rillig Exp $ */
# 3 "msg_015.c"
-// Test for message: function returns illegal type [15]
+// Test for message: function returns illegal type '%s' [15]
typedef int array[5];
-/* expect+1: error: function returns illegal type [15] */
+/* expect+1: error: function returns illegal type 'array[5] of int' [15] */
array invalid(void);
diff -r bc44962df411 -r fcc790240901 tests/usr.bin/xlint/lint1/msg_015.exp
--- a/tests/usr.bin/xlint/lint1/msg_015.exp Fri Apr 01 21:53:35 2022 +0000
+++ b/tests/usr.bin/xlint/lint1/msg_015.exp Fri Apr 01 22:07:23 2022 +0000
@@ -1,1 +1,1 @@
-msg_015.c(9): error: function returns illegal type [15]
+msg_015.c(9): error: function returns illegal type 'array[5] of int' [15]
diff -r bc44962df411 -r fcc790240901 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Fri Apr 01 21:53:35 2022 +0000
+++ b/usr.bin/xlint/lint1/decl.c Fri Apr 01 22:07:23 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.255 2022/04/01 20:38:37 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.256 2022/04/01 22:07:23 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: decl.c,v 1.255 2022/04/01 20:38:37 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.256 2022/04/01 22:07:23 rillig Exp $");
#endif
#include <sys/param.h>
@@ -973,8 +973,8 @@
}
if (to == FUNC) {
if (t == FUNC || t == ARRAY) {
- /* function returns illegal type */
- error(15);
+ /* function returns illegal type '%s' */
+ error(15, type_name(tp));
if (t == FUNC) {
*tpp = block_derive_type(*tpp, PTR);
} else {
diff -r bc44962df411 -r fcc790240901 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Fri Apr 01 21:53:35 2022 +0000
+++ b/usr.bin/xlint/lint1/err.c Fri Apr 01 22:07:23 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.153 2022/02/27 11:40:29 rillig Exp $ */
+/* $NetBSD: err.c,v 1.154 2022/04/01 22:07:23 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.153 2022/02/27 11:40:29 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.154 2022/04/01 22:07:23 rillig Exp $");
#endif
#include <sys/types.h>
@@ -69,7 +69,7 @@
"compiler takes size of function", /* 12 */
"incomplete enum type: %s", /* 13 */
"compiler takes alignment of function", /* 14 */
- "function returns illegal type", /* 15 */
+ "function returns illegal type '%s'", /* 15 */
"array of function is illegal", /* 16 */
"null dimension", /* 17 */
"illegal use of 'void'", /* 18 */
Home |
Main Index |
Thread Index |
Old Index