Workaround 'AST broken' syntax error reported by cppcheck in GC_mark_some
authorIvan Maidanski <ivmai@mail.ru>
Fri, 9 Nov 2018 08:35:37 +0000 (11:35 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 9 Nov 2018 08:38:40 +0000 (11:38 +0300)
Cppcheck does not support GNU-specific "&&label" syntax currently.

* mark.c [WRAP_MARK_SOME && (MSWIN32 || MSWINCE) && __GNUC__
&& !GC_GNUC_PREREQ(4,7) && !GC_CLANG_PREREQ(3,3)] (GC_mark_some): Skip
"er.alt_path=&&handle_ex" statement if CPPCHECK.

mark.c

diff --git a/mark.c b/mark.c
index 0ee0a57..12d927f 100644 (file)
--- a/mark.c
+++ b/mark.c
@@ -526,7 +526,7 @@ static void alloc_mark_stack(size_t);
 #       endif
         er.alt_path = &&handle_ex;
 #       pragma GCC diagnostic pop
-#     else /* pragma diagnostic is not supported */
+#     elif !defined(CPPCHECK) /* pragma diagnostic is not supported */
         er.alt_path = &&handle_ex;
 #     endif
       er.ex_reg.handler = mark_ex_handler;