Module Name: src
Committed By: rillig
Date: Sun Sep 5 19:58:53 UTC 2021
Modified Files:
src/usr.bin/xlint/lint2: read.c
Log Message:
lint: remove source code references from internal error message
The additional strings that are provided with the error message are
distinctive enough.
To generate a diff of this commit:
cvs rdiff -u -r1.66 -r1.67 src/usr.bin/xlint/lint2/read.c
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/lint2/read.c
diff -u src/usr.bin/xlint/lint2/read.c:1.66 src/usr.bin/xlint/lint2/read.c:1.67
--- src/usr.bin/xlint/lint2/read.c:1.66 Sun Sep 5 19:44:56 2021
+++ src/usr.bin/xlint/lint2/read.c Sun Sep 5 19:58:53 2021
@@ -1,4 +1,4 @@
-/* $NetBSD: read.c,v 1.66 2021/09/05 19:44:56 rillig Exp $ */
+/* $NetBSD: read.c,v 1.67 2021/09/05 19:58:53 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: read.c,v 1.66 2021/09/05 19:44:56 rillig Exp $");
+__RCSID("$NetBSD: read.c,v 1.67 2021/09/05 19:58:53 rillig Exp $");
#endif
#include <ctype.h>
@@ -72,7 +72,7 @@ static size_t nfnames;
/*
* Types are shared (to save memory for the types itself) and accessed
* via indices (to save memory for references to types (indices are short)).
- * To share types, a equal type must be located fast. This is done by a
+ * To share types, an equal type must be located fast. This is done by a
* hash table. Access by indices is done via an array of pointers to the
* types.
*/
@@ -91,9 +91,8 @@ static hte_t **renametab;
static int csrcfile;
-#define inperr(fmt, args...) \
- inperror(__FILE__, __LINE__, fmt, ##args)
-static void inperror(const char *, size_t, const char *, ...);
+static void inperr(const char *, ...)
+ __attribute__((format(printf, 1, 2), noreturn));
static void setsrc(const char *);
static void setfnid(int, const char *);
static void funccall(pos_t *, const char *);
@@ -243,8 +242,8 @@ readfile(const char *name)
}
-static void __attribute__((format(printf, 3, 4))) __attribute__((noreturn))
-inperror(const char *file, size_t line, const char *fmt, ...)
+static void
+inperr(const char *fmt, ...)
{
va_list ap;
char buf[1024];
@@ -253,7 +252,7 @@ inperror(const char *file, size_t line,
(void)vsnprintf(buf, sizeof(buf), fmt, ap);
va_end(ap);
- errx(1, "%s,%zu: input file error: %s,%zu (%s)", file, line,
+ errx(1, "input file error: %s,%zu (%s)",
fnames[srcfile], flines[srcfile], buf);
}