BR: 2196966: make the -w/-W options work again

The code to parse the -w/-W options was updating warning_on[], not
warning_on_global[], but warning_on[] is reset at the beginning of
each pass (to let the warning directive work); as a result the -w/-W
options don't actually do anything at all.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin 2008-10-26 08:57:13 -07:00
parent b21141a301
commit 6f4e92b760

6
nasm.c
View file

@ -835,13 +835,13 @@ static bool process_arg(char *p, char *q)
if (!nasm_stricmp(param, warnings[i].name))
break;
if (i <= ERR_WARN_MAX)
warning_on[i] = do_warn;
warning_on_global[i] = do_warn;
else if (!nasm_stricmp(param, "all"))
for (i = 1; i <= ERR_WARN_MAX; i++)
warning_on[i] = do_warn;
warning_on_global[i] = do_warn;
else if (!nasm_stricmp(param, "none"))
for (i = 1; i <= ERR_WARN_MAX; i++)
warning_on[i] = !do_warn;
warning_on_global[i] = !do_warn;
else
report_error(ERR_NONFATAL | ERR_NOFILE | ERR_USAGE,
"invalid warning `%s'", param);