mirror of
https://github.com/netwide-assembler/nasm.git
synced 2025-03-07 17:46:58 +08:00
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>
This commit is contained in:
parent
b1ef4345a9
commit
12df4dd12f
@ -241,8 +241,12 @@ bool set_warning_status(const char *value)
|
|||||||
|
|
||||||
vlen = value ? strlen(value) : 0;
|
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;
|
enum warn_index i = wa->warning;
|
||||||
|
|
||||||
if (value) {
|
if (value) {
|
||||||
|
Loading…
Reference in New Issue
Block a user