@@ -1400,8 +1400,7 @@ static int do_handle_undef(struct stream *stream, struct token **line, struct to
return 1;
if (attr == sym->attr && sym->namespace == NS_UNDEF)
return 1;
- } else if (attr <= SYM_ATTR_NORMAL)
- return 1;
+ }
if (!sym || sym->scope != file_scope) {
sym = alloc_symbol(left->pos, SYM_NODE);
@@ -6,9 +6,11 @@
#define DEF xyz
#define NYDEF ydef
+
+#undef NDEF2
/*
* check-name: dump-macros
- * check-command: sparse -E -dD -DIJK=ijk -UNDEF -UNYDEF $file
+ * check-command: sparse -E -dD -DIJK=ijk -UNDEF1 -UNYDEF $file
*
* check-output-ignore
check-output-pattern-1-times: #define __CHECKER__ 1
@@ -16,4 +18,6 @@ check-output-contains: #define IJK ijk
check-output-contains: #define DEF xyz
check-output-contains: #define NYDEF ydef
check-output-contains: #undef ABC
+check-output-contains: #undef NDEF1
+check-output-contains: #undef NDEF2
*/
Note: to support this, we have to create a symbol where it wasn't needed before. Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com> --- pre-process.c | 3 +-- validation/preprocessor/dump-macros.c | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-)