diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-01-22 14:08:36 -0800 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-01-22 14:08:36 -0800 |
commit | 2b046cf67fd529aace7026b499a440cd4ba0fa6d (patch) | |
tree | d9c3d057c1ce81abea2652549ec67f9e6433dd93 /nasm.c | |
parent | c221523976662fdaf0a90eb6357e637c82abcd6a (diff) | |
download | nasm-2b046cf67fd529aace7026b499a440cd4ba0fa6d.tar.gz nasm-2b046cf67fd529aace7026b499a440cd4ba0fa6d.tar.bz2 nasm-2b046cf67fd529aace7026b499a440cd4ba0fa6d.zip |
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.
Diffstat (limited to 'nasm.c')
-rw-r--r-- | nasm.c | 17 |
1 files changed, 7 insertions, 10 deletions
@@ -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)); } /** |