diff --git a/.github/workflows/check-c.yml b/.github/workflows/check-c.yml index deadfcb07..c308e3620 100644 --- a/.github/workflows/check-c.yml +++ b/.github/workflows/check-c.yml @@ -93,11 +93,13 @@ jobs: run: sudo apt-get update -qy - name: install cppcheck run: sudo apt-get install -qy cppcheck + - name: configure + run: > + ./configure CPPCHECK='cppcheck -q' + || (cat config.log; exit 1) - run: cppcheck --version - name: cppcheck - run: > - cppcheck -q --force --error-exitcode=1 --enable=warning,performance - -i src/firejail/checkcfg.c -i src/firejail/main.c . + run: make cppcheck # new cppcheck version currently chokes on checkcfg.c and main.c, therefore # scan all files also with older cppcheck version from ubuntu 20.04. @@ -122,9 +124,13 @@ jobs: run: sudo apt-get update -qy - name: install cppcheck run: sudo apt-get install -qy cppcheck + - name: configure + run: > + ./configure CPPCHECK='cppcheck -q' + || (cat config.log; exit 1) - run: cppcheck --version - - name: cppcheck - run: cppcheck -q --force --error-exitcode=1 --enable=warning,performance . + - name: cppcheck-old + run: make cppcheck-old codeql-cpp: permissions: diff --git a/Makefile b/Makefile index e46eb4949..d6d4f098c 100644 --- a/Makefile +++ b/Makefile @@ -364,6 +364,12 @@ extras: all .PHONY: cppcheck cppcheck: clean + $(CPPCHECK) --force --error-exitcode=1 --enable=warning,performance \ + -i src/firejail/checkcfg.c -i src/firejail/main.c . + +# For cppcheck 1.x; see .github/workflows/check-c.yml +.PHONY: cppcheck-old +cppcheck-old: clean $(CPPCHECK) --force --error-exitcode=1 --enable=warning,performance . .PHONY: scan-build