• Ulrich Sibiller's avatar
    Suppress false positives in static analysis · c8a5e33f
    Ulrich Sibiller authored
    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.
    c8a5e33f
run-static-analysis.sh 574 Bytes
#!/bin/bash

if [[ "${STATIC_ANALYSIS}" == "yes" ]]; then
    # cppcheck
    if ! [ -x "$(command -v cppcheck)" ]; then
        echo 'Error: cppcheck is not installed.' >&2
        exit 1
    fi
    CPPCHECK_OPTS='--error-exitcode=0 --force --quiet --suppressions-list=./static-analysis-suppressions'
    # we exclude some external projects
    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