From: dick Date: Fri, 30 Sep 1988 15:20:24 +0000 (+0000) Subject: refinements in error reporting X-Git-Tag: release-5-5~2820 X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=1fb9c249b36ea7a24c8af8e79a39cd5115addcbd;p=ack.git refinements in error reporting --- diff --git a/lang/cem/lint/lpass2/lpass2.c b/lang/cem/lint/lpass2/lpass2.c index 96ba59182..c4d6597b1 100644 --- a/lang/cem/lint/lpass2/lpass2.c +++ b/lang/cem/lint/lpass2/lpass2.c @@ -342,9 +342,11 @@ PRIVATE stat_def(stnr) dot, funvar(dot), dot->id_name, lib); } if (ext) { - report("%L: %s %s also %s at %L", - dot, funvar(dot), dot->id_name, - defdec(ext), ext); + if (!streq(dot->id_file, ext->id_file)) { + report("%L: %s %s also %s at %L", + dot, funvar(dot), dot->id_name, + defdec(ext), ext); + } } sta = dot; dot = new_inpdef(); diff --git a/lang/cem/lint/lpass2/read.c b/lang/cem/lint/lpass2/read.c index 435f2bc56..cc47ca1ca 100644 --- a/lang/cem/lint/lpass2/read.c +++ b/lang/cem/lint/lpass2/read.c @@ -10,7 +10,7 @@ #include -#define INP_NPUSHBACK 2 +#define INP_NPUSHBACK 1 #include #include @@ -79,10 +79,6 @@ get_id(id) if (!ReadString(id->id_file, '\n', FNAMESIZE)) return 0; - { extern char loptions[]; - if (loptions['X']) - print_id("read", id);/*???*/ - } return (1); } @@ -174,7 +170,6 @@ ReadArgs(nrargs, buf) */ int i; int charcount = 1; - int n; if (nrargs < 0) { /* variable # of args */ @@ -182,6 +177,8 @@ ReadArgs(nrargs, buf) } *buf = '\0'; for (i = 0; i < nrargs; i++) { + int n; + if (!ReadString(buf, ':', ARGTPSSIZE-charcount-1)) return 0; n = strlen(buf) + 1; diff --git a/lang/cem/lint/lpass2/report.c b/lang/cem/lint/lpass2/report.c index 557260baf..333fa784d 100644 --- a/lang/cem/lint/lpass2/report.c +++ b/lang/cem/lint/lpass2/report.c @@ -7,11 +7,15 @@ #include #include +#include "private.h" +#include "class.h" #include "inpdef.h" #define MSGOUT STDERR /* filedes on which to write the messages */ #define ERROUT STDERR /* filedes on which to write the panics */ +PRIVATE rep_loc(); + /* VARARGS */ report(va_alist) va_dcl @@ -25,7 +29,8 @@ report(va_alist) register char fc; /* First see if the first arg is an inpdef with - a global file name; if so, skip this message. + a global file name not ending in .c; if so, + skip this message. */ if (f[0] == '%' && f[1] == 'L') { /* it is an inpdef */ @@ -57,8 +62,7 @@ report(va_alist) register int i; case 'L': /* a location item */ id = va_arg(ap, struct inpdef *); - fprint(MSGOUT, "\"%s\", line %d", - id->id_file, id->id_line); + rep_loc(id); break; case 's': /* a string item */ s = va_arg(ap, char *); @@ -82,6 +86,19 @@ report(va_alist) va_end(ap); } +PRIVATE +rep_loc(id) + struct inpdef *id; +{ + if (is_class(id, CL_LIB)) { + fprint(MSGOUT, "library file %s", id->id_file); + } + else { + fprint(MSGOUT, "\"%s\", line %d", + id->id_file, id->id_line); + } +} + /* VARARGS1 */ panic(fmt, args) char *fmt;