Ignore ERR_PASS1 except for actual warnings

is_suppressed_warning() should never return true unless we're actually
dealing with a warning.  There is a handful of cases where we pass
ERR_PASS1 down together with errors, but that's mostly because it fits
into an overall pattern.  Thus, ignore it.
This commit is contained in:
H. Peter Anvin 2008-01-22 14:08:36 -08:00
parent c221523976
commit 2b046cf67f

17
nasm.c
View File

@ -43,7 +43,7 @@ static void report_error_gnu(int severity, const char *fmt, ...);
static void report_error_vc(int severity, const char *fmt, ...);
static void report_error_common(int severity, const char *fmt,
va_list args);
static int is_suppressed_warning(int severity);
static bool is_suppressed_warning(int severity);
static void usage(void);
static efunc report_error;
@ -1614,19 +1614,16 @@ static void report_error_vc(int severity, const char *fmt, ...)
* @param severity the severity of the warning or error
* @return true if we should abort error/warning printing
*/
static int is_suppressed_warning(int severity)
static bool is_suppressed_warning(int severity)
{
/*
* See if it's a suppressed warning.
*/
return ((severity & ERR_MASK) == ERR_WARNING &&
(severity & ERR_WARN_MASK) != 0 &&
suppressed[(severity & ERR_WARN_MASK) >> ERR_WARN_SHR]) ||
/*
* See if it's a pass-one only warning and we're not in pass
* zero or one.
*/
((severity & ERR_PASS1) && pass0 != 1);
return (severity & ERR_MASK) == ERR_WARNING &&
(((severity & ERR_WARN_MASK) != 0 &&
suppressed[(severity & ERR_WARN_MASK) >> ERR_WARN_SHR]) ||
/* See if it's a pass-one only warning and we're not in pass one. */
((severity & ERR_PASS1) && pass0 != 1));
}
/**