@@ -250,6 +250,8 @@ int Wvla = 1;
int dbg_entry = 0;
int dbg_dead = 0;
+int dump_macro_defs = 0;
+
int preprocess_only;
static enum { STANDARD_C89,
@@ -567,6 +569,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)
{
@@ -800,6 +815,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);
@@ -137,6 +137,8 @@ extern int Wvla;
extern int dbg_entry;
extern int dbg_dead;
+extern int dump_macro_defs;
+
extern int arch_m64;
extern void declare_builtin_functions(void);
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- lib.c | 16 ++++++++++++++++ lib.h | 2 ++ 2 files changed, 18 insertions(+)