Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/xlint/common make outname print where it came from i...



details:   https://anonhg.NetBSD.org/src/rev/9f389897b2ab
branches:  trunk
changeset: 328780:9f389897b2ab
user:      christos <christos%NetBSD.org@localhost>
date:      Thu Apr 17 18:52:03 2014 +0000

description:
make outname print where it came from in case of error

diffstat:

 usr.bin/xlint/common/emit.c    |  8 ++++----
 usr.bin/xlint/common/externs.h |  5 +++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (49 lines):

diff -r 3d102843a604 -r 9f389897b2ab usr.bin/xlint/common/emit.c
--- a/usr.bin/xlint/common/emit.c       Thu Apr 17 18:37:07 2014 +0000
+++ b/usr.bin/xlint/common/emit.c       Thu Apr 17 18:52:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: emit.c,v 1.5 2009/04/15 01:20:57 christos Exp $        */
+/*     $NetBSD: emit.c,v 1.6 2014/04/17 18:52:03 christos Exp $        */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: emit.c,v 1.5 2009/04/15 01:20:57 christos Exp $");
+__RCSID("$NetBSD: emit.c,v 1.6 2014/04/17 18:52:03 christos Exp $");
 #endif
 
 #include <ctype.h>
@@ -216,11 +216,11 @@
  * the name is preceded by its length
  */
 void
-outname(const char *name)
+outname1(const char *file, size_t line, const char *name)
 {
 
        if (name == NULL)
-               errx(1, "internal error: outname() 1");
+               errx(1, "%s, %zu: internal error: outname(NULL)", file, line);
        outint((int)strlen(name));
        outstrg(name);
 }
diff -r 3d102843a604 -r 9f389897b2ab usr.bin/xlint/common/externs.h
--- a/usr.bin/xlint/common/externs.h    Thu Apr 17 18:37:07 2014 +0000
+++ b/usr.bin/xlint/common/externs.h    Thu Apr 17 18:52:03 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: externs.h,v 1.4 2005/04/07 16:28:40 christos Exp $     */
+/*     $NetBSD: externs.h,v 1.5 2014/04/17 18:52:03 christos Exp $     */
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -69,5 +69,6 @@
 extern void    outqchar(int);
 extern void    outstrg(const char *);
 extern void    outint(int);
-extern void    outname(const char *);
+#define outname(a)     outname1(__FILE__, __LINE__, a);
+extern void    outname1(const char *, size_t, const char *);
 extern void    outsrc(const char *);



Home | Main Index | Thread Index | Old Index