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: unexport lint's messages
details: https://anonhg.NetBSD.org/src/rev/d2ba12d5e922
branches: trunk
changeset: 366794:d2ba12d5e922
user: rillig <rillig%NetBSD.org@localhost>
date: Wed Jun 15 18:06:51 2022 +0000
description:
lint: unexport lint's messages
There was only a single place where a message was used directly, instead
of calling one of the several functions for this purpose.
diffstat:
usr.bin/xlint/lint1/decl.c | 8 ++++----
usr.bin/xlint/lint1/err.c | 6 +++---
usr.bin/xlint/lint1/externs1.h | 3 +--
3 files changed, 8 insertions(+), 9 deletions(-)
diffs (73 lines):
diff -r a994c713b7e7 -r d2ba12d5e922 usr.bin/xlint/lint1/decl.c
--- a/usr.bin/xlint/lint1/decl.c Wed Jun 15 17:57:16 2022 +0000
+++ b/usr.bin/xlint/lint1/decl.c Wed Jun 15 18:06:51 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.286 2022/06/15 17:57:16 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.287 2022/06/15 18:06:51 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: decl.c,v 1.286 2022/06/15 17:57:16 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.287 2022/06/15 18:06:51 rillig Exp $");
#endif
#include <sys/param.h>
@@ -850,8 +850,8 @@
switch (tp->t_tspec) {
case FUNC:
- /* compiler takes size of function */
- INTERNAL_ERROR("%s", msgs[12]);
+ lint_assert(/*CONSTCOND*/ false);
+ break; /* GCC 10 thinks this were reachable */
/* NOTREACHED */
case STRUCT:
case UNION:
diff -r a994c713b7e7 -r d2ba12d5e922 usr.bin/xlint/lint1/err.c
--- a/usr.bin/xlint/lint1/err.c Wed Jun 15 17:57:16 2022 +0000
+++ b/usr.bin/xlint/lint1/err.c Wed Jun 15 18:06:51 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.169 2022/06/11 12:23:59 rillig Exp $ */
+/* $NetBSD: err.c,v 1.170 2022/06/15 18:06:51 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID)
-__RCSID("$NetBSD: err.c,v 1.169 2022/06/11 12:23:59 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.170 2022/06/15 18:06:51 rillig Exp $");
#endif
#include <sys/types.h>
@@ -53,7 +53,7 @@
int sytxerr;
-const char *const msgs[] = {
+static const char *const msgs[] = {
"empty declaration", /* 0 */
"old style declaration; add 'int'", /* 1 */
"empty declaration", /* 2 */
diff -r a994c713b7e7 -r d2ba12d5e922 usr.bin/xlint/lint1/externs1.h
--- a/usr.bin/xlint/lint1/externs1.h Wed Jun 15 17:57:16 2022 +0000
+++ b/usr.bin/xlint/lint1/externs1.h Wed Jun 15 18:06:51 2022 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.160 2022/04/30 22:31:23 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.161 2022/06/15 18:06:51 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -153,7 +153,6 @@
*/
extern int nerr;
extern int sytxerr;
-extern const char *const msgs[];
extern void msglist(void);
extern void error_at(int, const pos_t *, ...);
Home |
Main Index |
Thread Index |
Old Index