Merge pull request #803 from libexpat/fix-cppcheck-ci

Fix Cppcheck CI for Cppcheck 2.13.0
This commit is contained in:
Sebastian Pipping 2024-01-16 01:14:12 +01:00 committed by GitHub
commit c47e191797
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 26 additions and 20 deletions

View file

@ -41,7 +41,7 @@ permissions:
jobs:
checks:
name: Run Cppcheck
runs-on: macos-11
runs-on: macos-12
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install runtime dependencies

View file

@ -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