summaryrefslogtreecommitdiff
path: root/nasm.c
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2012-02-24 21:50:53 -0800
committerH. Peter Anvin <hpa@zytor.com>2012-02-24 21:50:53 -0800
commit442a05a8975d53e5e56dd7630ae4480150e5bff4 (patch)
tree909bc4184f67f0dc677caab4c11f2081ecaa17b1 /nasm.c
parent10da41e328f24a6cc252d0c69f2f09c824341a2a (diff)
downloadnasm-442a05a8975d53e5e56dd7630ae4480150e5bff4.tar.gz
nasm-442a05a8975d53e5e56dd7630ae4480150e5bff4.tar.bz2
nasm-442a05a8975d53e5e56dd7630ae4480150e5bff4.zip
nasm.c: Fix is_suppressed_warning()
The logic in is_suppressed_warning() was severely wrong, which would cause a lot of legitimate warnings to be suppressed while some warnings would be duplicated. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'nasm.c')
-rw-r--r--nasm.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/nasm.c b/nasm.c
index c6ddc73..cca6650 100644
--- a/nasm.c
+++ b/nasm.c
@@ -1915,23 +1915,20 @@ static void nasm_verror_vc(int severity, const char *fmt, va_list ap)
*/
static bool is_suppressed_warning(int severity)
{
-
/* Not a warning at all */
if ((severity & ERR_MASK) != ERR_WARNING)
return false;
- /* Might be a warning but suppresed explicitly */
- if (severity & ERR_WARN_MASK) {
- if (warning_on[WARN_IDX(severity)])
- return false;
- }
-
/* See if it's a pass-one only warning and we're not in pass one. */
if (((severity & ERR_PASS1) && pass0 != 1) ||
((severity & ERR_PASS2) && pass0 != 2))
return true;
- return true;
+ /* Might be a warning but suppresed explicitly */
+ if (severity & ERR_WARN_MASK)
+ return !warning_on[WARN_IDX(severity)];
+ else
+ return false;
}
/**