Module Name: src
Committed By: rillig
Date: Sat Mar 27 12:42:22 UTC 2021
Modified Files:
src/usr.bin/xlint/common: tyname.c
src/usr.bin/xlint/lint1: decl.c err.c externs1.h lex.c lint1.h
Log Message:
lint: rename LERROR to INTERNAL_ERROR
The '#ifndef' in tyname.c is meant to distinguish between lint1 and
lint2, it is not meant to be defined from anywhere outside the lint code
itself.
No functional change.
To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/usr.bin/xlint/common/tyname.c
cvs rdiff -u -r1.163 -r1.164 src/usr.bin/xlint/lint1/decl.c
cvs rdiff -u -r1.95 -r1.96 src/usr.bin/xlint/lint1/err.c
cvs rdiff -u -r1.90 -r1.91 src/usr.bin/xlint/lint1/externs1.h
cvs rdiff -u -r1.19 -r1.20 src/usr.bin/xlint/lint1/lex.c
cvs rdiff -u -r1.89 -r1.90 src/usr.bin/xlint/lint1/lint1.h
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/xlint/common/tyname.c
diff -u src/usr.bin/xlint/common/tyname.c:1.35 src/usr.bin/xlint/common/tyname.c:1.36
--- src/usr.bin/xlint/common/tyname.c:1.35 Fri Mar 26 20:31:07 2021
+++ src/usr.bin/xlint/common/tyname.c Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: tyname.c,v 1.35 2021/03/26 20:31:07 rillig Exp $ */
+/* $NetBSD: tyname.c,v 1.36 2021/03/27 12:42:22 rillig Exp $ */
/*-
* Copyright (c) 2005 The NetBSD Foundation, Inc.
@@ -35,7 +35,7 @@
#include <sys/cdefs.h>
#if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: tyname.c,v 1.35 2021/03/26 20:31:07 rillig Exp $");
+__RCSID("$NetBSD: tyname.c,v 1.36 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <limits.h>
@@ -45,8 +45,8 @@ __RCSID("$NetBSD: tyname.c,v 1.35 2021/0
#include PASS
-#ifndef LERROR
-#define LERROR(fmt, args...) \
+#ifndef INTERNAL_ERROR
+#define INTERNAL_ERROR(fmt, args...) \
do { \
(void)warnx("%s, %d: " fmt, __FILE__, __LINE__, ##args); \
abort(); \
@@ -180,7 +180,7 @@ tspec_name(tspec_t t)
case DCOMPLEX: return "double _Complex";
case LCOMPLEX: return "long double _Complex";
default:
- LERROR("tspec_name(%d)", t);
+ INTERNAL_ERROR("tspec_name(%d)", t);
return NULL;
}
}
@@ -244,7 +244,7 @@ sametype(const type_t *t1, const type_t
return true;
#endif
default:
- LERROR("tyname(%d)", t);
+ INTERNAL_ERROR("tyname(%d)", t);
return false;
}
}
@@ -402,7 +402,7 @@ type_name(const type_t *tp)
type_name_of_function(&buf, tp);
break;
default:
- LERROR("type_name(%d)", t);
+ INTERNAL_ERROR("type_name(%d)", t);
}
name = intern(buf.data);
Index: src/usr.bin/xlint/lint1/decl.c
diff -u src/usr.bin/xlint/lint1/decl.c:1.163 src/usr.bin/xlint/lint1/decl.c:1.164
--- src/usr.bin/xlint/lint1/decl.c:1.163 Sat Mar 27 11:08:00 2021
+++ src/usr.bin/xlint/lint1/decl.c Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: decl.c,v 1.163 2021/03/27 11:08:00 rillig Exp $ */
+/* $NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 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.163 2021/03/27 11:08:00 rillig Exp $");
+__RCSID("$NetBSD: decl.c,v 1.164 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <sys/param.h>
@@ -823,7 +823,7 @@ deftyp(void)
case LCOMPLEX:
break;
default:
- LERROR("deftyp(%s)", tspec_name(t));
+ INTERNAL_ERROR("deftyp(%s)", tspec_name(t));
}
if (t != INT && t != CHAR && (s != NOTSPEC || l != NOTSPEC)) {
dcs->d_terr = true;
@@ -909,7 +909,7 @@ length(const type_t *tp, const char *nam
switch (tp->t_tspec) {
case FUNC:
/* compiler takes size of function */
- LERROR("%s", msgs[12]);
+ INTERNAL_ERROR("%s", msgs[12]);
/* NOTREACHED */
case STRUCT:
case UNION:
@@ -928,7 +928,7 @@ length(const type_t *tp, const char *nam
default:
elsz = size_in_bits(tp->t_tspec);
if (elsz <= 0)
- LERROR("length(%d)", elsz);
+ INTERNAL_ERROR("length(%d)", elsz);
break;
}
return elem * elsz;
Index: src/usr.bin/xlint/lint1/err.c
diff -u src/usr.bin/xlint/lint1/err.c:1.95 src/usr.bin/xlint/lint1/err.c:1.96
--- src/usr.bin/xlint/lint1/err.c:1.95 Fri Mar 26 23:17:33 2021
+++ src/usr.bin/xlint/lint1/err.c Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: err.c,v 1.95 2021/03/26 23:17:33 rillig Exp $ */
+/* $NetBSD: err.c,v 1.96 2021/03/27 12:42:22 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.95 2021/03/26 23:17:33 rillig Exp $");
+__RCSID("$NetBSD: err.c,v 1.96 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <sys/types.h>
@@ -480,7 +480,7 @@ void
}
void
-lerror(const char *file, int line, const char *msg, ...)
+internal_error(const char *file, int line, const char *msg, ...)
{
va_list ap;
const char *fn;
Index: src/usr.bin/xlint/lint1/externs1.h
diff -u src/usr.bin/xlint/lint1/externs1.h:1.90 src/usr.bin/xlint/lint1/externs1.h:1.91
--- src/usr.bin/xlint/lint1/externs1.h:1.90 Sat Mar 27 12:32:19 2021
+++ src/usr.bin/xlint/lint1/externs1.h Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: externs1.h,v 1.90 2021/03/27 12:32:19 rillig Exp $ */
+/* $NetBSD: externs1.h,v 1.91 2021/03/27 12:42:22 rillig Exp $ */
/*
* Copyright (c) 1994, 1995 Jochen Pohl
@@ -124,7 +124,7 @@ extern void warning(int, ...);
extern void message(int, ...);
extern void gnuism(int, ...);
extern void c99ism(int, ...);
-extern void lerror(const char *, int, const char *, ...)
+extern void internal_error(const char *, int, const char *, ...)
__attribute__((__noreturn__,__format__(__printf__, 3, 4)));
extern void assert_failed(const char *, int, const char *, const char *)
__attribute__((__noreturn__));
Index: src/usr.bin/xlint/lint1/lex.c
diff -u src/usr.bin/xlint/lint1/lex.c:1.19 src/usr.bin/xlint/lint1/lex.c:1.20
--- src/usr.bin/xlint/lint1/lex.c:1.19 Sat Mar 27 12:32:19 2021
+++ src/usr.bin/xlint/lint1/lex.c Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lex.c,v 1.19 2021/03/27 12:32:19 rillig Exp $ */
+/* $NetBSD: lex.c,v 1.20 2021/03/27 12:42:22 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: lex.c,v 1.19 2021/03/27 12:32:19 rillig Exp $");
+__RCSID("$NetBSD: lex.c,v 1.20 2021/03/27 12:42:22 rillig Exp $");
#endif
#include <ctype.h>
@@ -785,7 +785,7 @@ lex_floating_constant(const char *yytext
errno = 0;
break;
default:
- LERROR("fcon(%s->%s)", cp, eptr);
+ INTERNAL_ERROR("fcon(%s->%s)", cp, eptr);
}
}
if (errno != 0)
@@ -1416,7 +1416,7 @@ getsym(sbuf_t *sb)
if (sym != NULL) {
if (sym->s_kind != symtyp)
- LERROR("getsym(%d, %d)", sym->s_kind, symtyp);
+ INTERNAL_ERROR("getsym(%d, %d)", sym->s_kind, symtyp);
symtyp = FVFT;
freesb(sb);
return sym;
Index: src/usr.bin/xlint/lint1/lint1.h
diff -u src/usr.bin/xlint/lint1/lint1.h:1.89 src/usr.bin/xlint/lint1/lint1.h:1.90
--- src/usr.bin/xlint/lint1/lint1.h:1.89 Fri Mar 26 19:17:58 2021
+++ src/usr.bin/xlint/lint1/lint1.h Sat Mar 27 12:42:22 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: lint1.h,v 1.89 2021/03/26 19:17:58 rillig Exp $ */
+/* $NetBSD: lint1.h,v 1.90 2021/03/27 12:42:22 rillig Exp $ */
/*
* Copyright (c) 1996 Christopher G. Demetriou. All Rights Reserved.
@@ -442,7 +442,8 @@ typedef struct err_set {
(((p)->errs_bits[(n)/__NERRBITS] & (1 << ((n) % __NERRBITS))) != 0)
#define ERR_ZERO(p) (void)memset((p), 0, sizeof(*(p)))
-#define LERROR(fmt, args...) lerror(__FILE__, __LINE__, fmt, ##args)
+#define INTERNAL_ERROR(fmt, args...) \
+ internal_error(__FILE__, __LINE__, fmt, ##args)
#define lint_assert(cond) \
do { \