From ed386877794b9535fb366dbba7383aef46b7f144 Mon Sep 17 00:00:00 2001 From: Sebastian Pipping Date: Mon, 15 Jan 2024 22:28:33 +0100 Subject: [PATCH] mass-cppcheck.sh: Fix for Cppcheck 2.13.0 Cppcheck output was: > expat/lib/xmlparse.c:67:4: error: #error XML_GE (for general entities) must be defined, [..] > # error XML_GE (for general entities) must be defined, [..] > ^ --- .github/workflows/scripts/mass-cppcheck.sh | 44 ++++++++++++---------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/.github/workflows/scripts/mass-cppcheck.sh b/.github/workflows/scripts/mass-cppcheck.sh index 582f8b36..56c13de9 100755 --- a/.github/workflows/scripts/mass-cppcheck.sh +++ b/.github/workflows/scripts/mass-cppcheck.sh @@ -39,24 +39,30 @@ cppcheck --version find --version | head -n1 -cppcheck_args=( - --quiet - --error-exitcode=1 - --force - --suppress=objectIndex - --suppress=unknownMacro -) +for xml_context_bytes in 0 1024; do + for xml_ge in 0 1; do + cppcheck_args=( + --quiet + --error-exitcode=1 + --force + --suppress=objectIndex + --suppress=unknownMacro + -DXML_CONTEXT_BYTES=${xml_context_bytes} + -DXML_GE=${xml_ge} + ) -find_args=( - -type f \( - -name \*.cpp - -o -name \*.c - \) - -not \( # Exclude .c files that are merely included by other files - -name xmltok_ns.c - -o -name xmltok_impl.c - \) - -exec cppcheck "${cppcheck_args[@]}" {} + -) + find_args=( + -type f \( + -name \*.cpp + -o -name \*.c + \) + -not \( # Exclude .c files that are merely included by other files + -name xmltok_ns.c + -o -name xmltok_impl.c + \) + -exec cppcheck "${cppcheck_args[@]}" {} + + ) -exec find "${find_args[@]}" + time find "${find_args[@]}" + done +done