From f00bd3bddf48b076923713e95a242add2ec33f1b Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Wed, 28 Nov 2018 12:09:59 +0300 Subject: [PATCH] Travis CI: Pass extra/gc.c to cppcheck --enable=unusedFunction (a cherry-pick of commit 53aa42b3 from 'master') This fixes a dozen of 'the function is never used' cppcheck style warnings (for GC_core_gcj_malloc, GC_durango_get_mem, GC_FreeBSDGetDataStart, GC_haiku_get_mem, GC_mprotect_resume, GC_mprotect_stop, GC_remove_roots_subregion, GC_win32_get_mem, GC_wince_get_mem). --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 20a041a5..506d993e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -27,11 +27,12 @@ matrix: - MAKEFILE_TARGETS="dist" - os: linux env: - - CPPCHECK_ENABLE="--enable=unusedFunction -D GC_BUILTIN_ATOMIC" + - CPPCHECK_ENABLE="--enable=unusedFunction -D GC_BUILTIN_ATOMIC extra/gc.c" + - CPPCHECK_OUT_FILTER="Z" - NO_CLONE_LIBATOMIC_OPS=true - os: linux env: - - CPPCHECK_ENABLE="-j4 --enable=information,performance,portability,style,warning extra/AmigaOS.c extra/MacOS.c extra/msvc_dbg.c extra/real_malloc.c extra/symbian.cpp" + - CPPCHECK_ENABLE="-j4 --enable=information,performance,portability,style,warning -I libatomic_ops/src extra/AmigaOS.c extra/MacOS.c extra/msvc_dbg.c extra/real_malloc.c extra/symbian.cpp *.c tools/*.c" - os: linux compiler: gcc env: @@ -605,10 +606,11 @@ script: tests/*.c tests/*.cc tools/*.c; fi - if [[ "$CPPCHECK_ENABLE" != "" ]]; then + if [[ "$CPPCHECK_OUT_FILTER" == "" ]]; then CPPCHECK_OUT_FILTER="c "; fi; set -o pipefail; ~/cppcheck/cppcheck --force --error-exitcode=2 - -U GC_API -D CPPCHECK -I include -I libatomic_ops/src - $CPPCHECK_ENABLE *.c *.cc cord/*.c cord/tests/*.c tests/*.c tests/*.cc - tools/*.c | grep --line-buffered "c "; + -U GC_API -D CPPCHECK -I include $CPPCHECK_ENABLE + *.cc cord/*.c cord/tests/*.c tests/*.c tests/*.cc | + grep --line-buffered "$CPPCHECK_OUT_FILTER"; fi - if [[ "$TESTS_CUSTOM_RUN" == true ]]; then ASAN_OPTIONS="detect_leaks=1" UBSAN_OPTIONS="halt_on_error=1" -- 2.40.0