Allow OPT to modify -W

Warning flags are processed individually;
PUSHO and POPO (re)store all the warning states.
This commit is contained in:
Rangi
2021-03-15 10:30:40 -04:00
committed by Eldred Habert
parent 2c30ab8731
commit d43408f4f3
8 changed files with 52 additions and 17 deletions

View File

@@ -15,6 +15,7 @@ void opt_B(char chars[2]);
void opt_G(char chars[4]);
void opt_P(uint8_t fill);
void opt_L(bool optimize);
void opt_W(char const *flag);
void opt_Parse(char const *option);
void opt_Push(void);

View File

@@ -13,6 +13,13 @@
extern unsigned int nbErrors;
enum WarningState {
WARNING_DEFAULT,
WARNING_DISABLED,
WARNING_ENABLED,
WARNING_ERROR
};
enum WarningID {
WARNING_ASSERT, /* Assertions */
WARNING_BACKWARDS_FOR, /* `for` loop with backwards range */
@@ -43,6 +50,9 @@ enum WarningID {
#define NB_META_WARNINGS (NB_WARNINGS_ALL - NB_WARNINGS)
};
extern enum WarningState warningStates[NB_WARNINGS];
extern bool warningsAreErrors;
void processWarningFlag(char const *flag);
/*