Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx> --- pre-process.c | 3 +++ validation/preprocessor/dump-macros.c | 1 + 2 files changed, 4 insertions(+) diff --git a/pre-process.c b/pre-process.c index 74414dfeb..63df3f71c 100644 --- a/pre-process.c +++ b/pre-process.c @@ -1406,6 +1406,7 @@ static int do_handle_undef(struct stream *stream, struct token **line, struct to if (!sym || sym->scope != file_scope) { sym = alloc_symbol(left->pos, SYM_NODE); bind_symbol(sym, left->ident, NS_MACRO); + add_ident(¯os, left->ident); } sym->namespace = NS_UNDEF; @@ -2063,5 +2064,7 @@ void dump_macro_definitions(void) struct symbol *sym = lookup_macro(name); if (sym) dump_macro(sym); + else + printf("#undef %s\n", show_ident(name)); } END_FOR_EACH_PTR(name); } diff --git a/validation/preprocessor/dump-macros.c b/validation/preprocessor/dump-macros.c index 79f3de6a2..5508233aa 100644 --- a/validation/preprocessor/dump-macros.c +++ b/validation/preprocessor/dump-macros.c @@ -15,4 +15,5 @@ check-output-pattern-1-times: #define __CHECKER__ 1 check-output-contains: #define IJK ijk check-output-contains: #define DEF xyz check-output-contains: #define NYDEF ydef +check-output-contains: #undef ABC */ -- 2.12.0 -- To unsubscribe from this list: send the line "unsubscribe linux-sparse" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html