diff options
author | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-04 15:46:31 -0700 |
---|---|---|
committer | H. Peter Anvin (Intel) <hpa@zytor.com> | 2020-06-04 15:59:47 -0700 |
commit | 12df4dd12f530f11e147a59be846c0453e79bb0c (patch) | |
tree | d1eecd21c001611ebdc517bb02d3248811070435 /asm | |
parent | b1ef4345a94cd8d3137e0c49870cf27839cfe102 (diff) | |
download | nasm-12df4dd12f530f11e147a59be846c0453e79bb0c.tar.gz |
asm/error.c: handle warning "all" correctly
warning_alias[0] is "all". It is represented in the loop by
value == NULL; WARN_IDX_ALL does not have an entry in warning_state[]
and so trying to poke it is an error.
Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
Diffstat (limited to 'asm')
-rw-r--r-- | asm/error.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/asm/error.c b/asm/error.c index ffe7a2e5..1e241c7b 100644 --- a/asm/error.c +++ b/asm/error.c @@ -241,8 +241,12 @@ bool set_warning_status(const char *value) vlen = value ? strlen(value) : 0; - /* This is inefficient, but it shouldn't matter... */ - for (wa = warning_alias; wa < &warning_alias[NUM_WARNING_ALIAS]; wa++) { + /* + * This is inefficient, but it shouldn't matter. + * Note: warning_alias[0] is "all". + */ + for (wa = warning_alias+1; + wa < &warning_alias[NUM_WARNING_ALIAS]; wa++) { enum warn_index i = wa->warning; if (value) { |