many little changes: removed some lint complaints; max_int and max_unsigned

are now constants if NOCROSS is defined; added lexstrict and expr_strict,
and changed calls where needed
This commit is contained in:
ceriel
1989-11-08 16:52:34 +00:00
parent 636c151d51
commit 67f9f2a74f
26 changed files with 164 additions and 141 deletions

View File

@@ -87,6 +87,19 @@ expr_error(va_alist) /* expr, fmt, args */
va_end(ap);
}
/*VARARGS*/
lexstrict(va_alist)
va_dcl
{
va_list ap;
va_start(ap);
{
_error(STRICT, FileName, LineNumber, ap);
}
va_end(ap);
}
/*VARARGS*/
strict(va_alist)
va_dcl
@@ -100,6 +113,24 @@ strict(va_alist)
va_end(ap);
}
/*VARARGS*/
expr_strict(va_alist) /* expr, fmt, args */
va_dcl
{
va_list ap;
va_start(ap);
{
struct expr *expr = va_arg(ap, struct expr *);
if (!(expr->ex_flags & EX_ERROR)) {
/* to prevent proliferation */
_error(STRICT, expr->ex_file, expr->ex_line, ap);
}
}
va_end(ap);
}
#ifdef DEBUG
/*VARARGS*/
debug(va_alist)
@@ -269,17 +300,20 @@ _error(class, fn, ln, ap)
unsigned int ln;
va_list ap;
{
/* _error attempts to limit the number of error messages
for a given line to MAXERR_LINE.
*/
#ifndef LINT
static char *last_fn = 0;
static unsigned int last_ln = 0;
static int e_seen = 0;
#endif LINT
char *remark;
char *fmt = va_arg(ap, char *);
/* check visibility of message */
switch (class) {
case WARNING:
case ERROR:
case STRICT:
if (token_nmb < tk_nmb_at_last_syn_err + ERR_SHADOW)
/* warning or error message overshadowed */
return;
break;
}
/* Since name and number are gathered from different places
depending on the class, we first collect the relevant
values and then decide what to print.
@@ -338,26 +372,6 @@ _error(class, fn, ln, ap)
/*NOTREACHED*/;
}
#ifndef LINT
if (class != DO_DEBUG) /* ??? DEBUG */
if (ln == last_ln && fn && last_fn && strcmp(fn, last_fn) == 0) {
/* we've seen this place before */
e_seen++;
if (e_seen == MAXERR_LINE)
fmt = "etc ...";
else
if (e_seen > MAXERR_LINE)
/* and too often, I'd say ! */
return;
}
else {
/* brand new place */
last_fn = fn;
last_ln = ln;
e_seen = 0;
}
#endif LINT
#ifdef LINT
if ( /* there is a file name */
fn