diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-04-04 16:55:07 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-05-19 13:35:26 +0200 |
| commit | 4605e11d7eed1a94e3c802081e58d1e45c707f82 (patch) | |
| tree | 70d3d6013b48c9445ca3301afa57c8de1541eedd | |
| parent | 9b4e30eb0baf0bf15a6045a00150224bdcc8f848 (diff) | |
| download | sparse-dev-4605e11d7eed1a94e3c802081e58d1e45c707f82.tar.gz | |
teach sparse how to handle -dD flag
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
| -rw-r--r-- | lib.c | 16 | ||||
| -rw-r--r-- | lib.h | 2 |
2 files changed, 18 insertions, 0 deletions
@@ -248,6 +248,8 @@ int Wuninitialized = 1; int Wunknown_attribute = 1; int Wvla = 1; +int dump_macro_defs = 0; + int dbg_entry = 0; int dbg_dead = 0; @@ -569,6 +571,19 @@ static char **handle_switch_v(char *arg, char **next) return next; } +static struct warning dumps[] = { + { "D", &dump_macro_defs}, +}; + +static char **handle_switch_d(char *arg, char **next) +{ + char ** ret = handle_onoff_switch(arg, next, dumps, ARRAY_SIZE(dumps)); + if (ret) + return ret; + + return next; +} + static void handle_onoff_switch_finalize(const struct warning warnings[], int n) { @@ -802,6 +817,7 @@ static char **handle_switch(char *arg, char **next) switch (*arg) { case 'a': return handle_switch_a(arg, next); case 'D': return handle_switch_D(arg, next); + case 'd': return handle_switch_d(arg, next); case 'E': return handle_switch_E(arg, next); case 'f': return handle_switch_f(arg, next); case 'g': return handle_switch_g(arg, next); @@ -135,6 +135,8 @@ extern int Wuninitialized; extern int Wunknown_attribute; extern int Wvla; +extern int dump_macro_defs; + extern int dbg_entry; extern int dbg_dead; |
