diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-12-12 16:11:08 -0800 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2018-12-12 16:11:08 -0800 |
commit | eb48c1191d0464c1a09503269fe09a33f43b8da9 (patch) | |
tree | 05654d9c1754f750f04e4f19b440eb8a3f1f3426 /asm/nasm.c | |
parent | 93367ea97b5984cd3b1b53d4ec9f3e6b7fd05a73 (diff) | |
download | nasm-eb48c1191d0464c1a09503269fe09a33f43b8da9.tar.gz nasm-eb48c1191d0464c1a09503269fe09a33f43b8da9.tar.xz nasm-eb48c1191d0464c1a09503269fe09a33f43b8da9.zip |
warnings: make it possible for a warning to default to an error
This allows us to do soft-migration of warnings to errors; they will
now be nonfatal errors by default, but gives the user the option to
demote them.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'asm/nasm.c')
-rw-r--r-- | asm/nasm.c | 9 |
1 files changed, 4 insertions, 5 deletions
@@ -1346,10 +1346,8 @@ static void parse_cmdline(int argc, char **argv, int pass) * Initialize all the warnings to their default state, including * warning index 0 used for "always on". */ - for (i = 0; i < WARN_ALL; i++) { - warning_state_init[i] = warning_state[i] = - warnings[i].enabled ? WARN_ST_ENABLED : 0; - } + for (i = 0; i < WARN_ALL; i++) + warning_state_init[i] = warning_state[i] = warnings[i].state; /* * First, process the NASMENV environment variable. @@ -2059,7 +2057,8 @@ static void help(const char xopt) printf(" %-23s %s%s\n", warnings[i].name, warnings[i].help, i == WARN_ALL ? "\n" : - warnings[i].enabled ? " [on]" : " [off]"); + (warnings[i].state & WARN_ST_ERROR) ? " [error]" : + (warnings[i].state & WARN_ST_ENABLED) ? " [on]" : " [off]"); if (xopt == 'f') { printf("valid output formats for -f are" |