From c8a5e33fcdde322f486d6c69e7e16fa346793fc9 Mon Sep 17 00:00:00 2001 From: Ulrich Sibiller Date: Thu, 20 Jun 2019 12:51:23 +0200 Subject: Suppress false positives in static analysis there's more work to do... The whole nx-X11/extras dir is no longer checked since we only have Mesa there and we do not want to check that mess... All the exceptions in static-analysis-suppressions have been manually checked. --- run-static-analysis.sh | 4 ++-- static-analysis-suppressions | 26 ++++++++++++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 static-analysis-suppressions diff --git a/run-static-analysis.sh b/run-static-analysis.sh index 0524c469a..a9368973b 100755 --- a/run-static-analysis.sh +++ b/run-static-analysis.sh @@ -6,9 +6,9 @@ if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then echo 'Error: cppcheck is not installed.' >&2 exit 1 fi - CPPCHECK_OPTS='--error-exitcode=0 --force --quiet' + CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions' # we exclude some external projects - CPPCHECK_EXCLUDES='-i ./nx-X11/extras/Mesa* -i ./nx-X11/extras/Mesa_* -i nx-X11/programs/Xserver/GL/mesa*' + CPPCHECK_EXCLUDES='-i ./nx-X11/extras/ -i nx-X11/programs/Xserver/GL/mesa* -i ./.pc -i ./nx-X11/.build-exports -i ./nx-X11/exports -i ./doc' echo "$(cppcheck --version):"; cppcheck $CPPCHECK_OPTS $CPPCHECK_EXCLUDES .; fi diff --git a/static-analysis-suppressions b/static-analysis-suppressions new file mode 100644 index 000000000..ebd6156e9 --- /dev/null +++ b/static-analysis-suppressions @@ -0,0 +1,26 @@ +memleak:nx-X11/programs/Xserver/dix/gc.c +memleak:nx-X11/lib/include/xtrans/Xtrans.c:982 +memleak:nx-X11/lib/include/xtrans/Xtrans.c:987 +memleak:nx-X11/lib/include/xtrans/Xtrans.c:1004 +memleak:nx-X11/lib/include/xtrans/Xtrans.c:1009 +uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1107 +uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1109 +uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1146 +uninitvar:nx-X11/lib/include/xtrans/Xtranssock.c:1148 +memleak:nx-X11/lib/include/xtrans/Xtranssock.c:2446 +memleak:nx-X11/lib/include/xtrans/Xtranssock.c:2458 +nullPointer:nx-X11/programs/Xserver/Xext/security.c +nullPointerArithmetic:nx-X11/programs/Xserver/randr/rrcrtc.c +nullPointerArithmetic:nx-X11/programs/Xserver/randr/rroutput.c +nullPointerArithmetic:nx-X11/programs/Xserver/randr/rrprovider.c +nullPointerArithmetic:nx-X11/programs/Xserver/randr/rrscreen.c +memleak:nx-X11/programs/Xserver/render/render.c:2929 +memleak:nx-X11/programs/Xserver/render/render.c:2991 +memleak:nx-X11/programs/Xserver/render/render.c:3049 +memleak:nx-X11/programs/Xserver/render/render.c:3103 +memleak:nx-X11/programs/Xserver/render/render.c:3157 +memleak:nx-X11/programs/Xserver/render/render.c:3288 +doubleFree:nx-X11/programs/Xserver/hw/nxagent/Keyboard.c:1699 +uninitStructMember:nx-X11/programs/Xserver/mi/miwideline.c:190 +invalidFree:nxcomp/src/EncodeBuffer.cpp:84 +invalidFree:nxcomp/src/EncodeBuffer.cpp:106 -- cgit v1.2.3