0
0
mirror of https://github.com/netwide-assembler/nasm.git synced 2025-09-22 10:43:39 -04:00

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>
This commit is contained in:
H. Peter Anvin (Intel)
2018-12-12 16:11:08 -08:00
parent 93367ea97b
commit eb48c1191d
3 changed files with 40 additions and 38 deletions

View File

@@ -120,17 +120,16 @@ static inline vefunc nasm_set_verror(vefunc ve)
#define WARN_ALL (22+2) /* Do not use WARN() here */
#define WARN_OTHER WARN(WARN_ALL-1) /* any noncategorized warning */
struct warning {
const char *name;
const char *help;
bool enabled;
};
extern const struct warning warnings[WARN_ALL+1];
/* This is a bitmask */
#define WARN_ST_ENABLED 1 /* Warning is currently enabled */
#define WARN_ST_ERROR 2 /* Treat this warning as an error */
struct warning {
const char *name;
const char *help;
uint8_t state; /* Default state for this warning */
};
extern const struct warning warnings[WARN_ALL+1];
extern uint8_t warning_state[WARN_ALL];
extern uint8_t warning_state_init[WARN_ALL];