aboutsummaryrefslogtreecommitdiffstats
path: root/include/error.h
diff options
context:
space:
mode:
authorH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-12 16:11:08 -0800
committerH. Peter Anvin (Intel) <hpa@zytor.com>2018-12-12 16:11:08 -0800
commiteb48c1191d0464c1a09503269fe09a33f43b8da9 (patch)
tree05654d9c1754f750f04e4f19b440eb8a3f1f3426 /include/error.h
parent93367ea97b5984cd3b1b53d4ec9f3e6b7fd05a73 (diff)
downloadnasm-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 'include/error.h')
-rw-r--r--include/error.h11
1 files changed, 5 insertions, 6 deletions
diff --git a/include/error.h b/include/error.h
index 1d904849..cd64a497 100644
--- a/include/error.h
+++ b/include/error.h
@@ -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 */
+/* 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;
- bool enabled;
+ uint8_t state; /* Default state for this warning */
};
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 */
-
extern uint8_t warning_state[WARN_ALL];
extern uint8_t warning_state_init[WARN_ALL];