mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-01-18 16:25:05 +08:00
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:
parent
c221523976
commit
2b046cf67f
17
nasm.c
17
nasm.c
@ -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));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user