summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-01-22 14:08:36 -0800
committerH. Peter Anvin <hpa@zytor.com>2008-01-22 14:08:36 -0800
commit2b046cf67fd529aace7026b499a440cd4ba0fa6d (patch)
treed9c3d057c1ce81abea2652549ec67f9e6433dd93
parentc221523976662fdaf0a90eb6357e637c82abcd6a (diff)
downloadnasm-2b046cf67fd529aace7026b499a440cd4ba0fa6d.tar.gz
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.
-rw-r--r--nasm.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/nasm.c b/nasm.c
index cdb1e745..9c4cd9ba 100644
--- a/nasm.c
+++ b/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));
}
/**