mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 15:31:17 +01:00
dist: default cppcheck to ignore unusedStructMember
This commit is contained in:
parent
73dddfb601
commit
edd948c176
13
dist/tools/cppcheck/README.md
vendored
13
dist/tools/cppcheck/README.md
vendored
@ -15,12 +15,19 @@ Check all files changed in the current branch against the branch named
|
||||
|
||||
Check all files but ignore warnings about unused struct members:
|
||||
|
||||
./dist/tools/cppcheck/check.sh --suppress=unusedStructMember
|
||||
./dist/tools/cppcheck/check.sh --suppress=unassignedVariable
|
||||
|
||||
Check all files changed in the current branch against the branch named
|
||||
'master', ignoring warnings about unused struct members:
|
||||
'master', ignoring warnings about unassigned variables:
|
||||
|
||||
./dist/tools/cppcheck/check.sh master --suppress=unusedStructMember --suppress=unassignedVariable
|
||||
./dist/tools/cppcheck/check.sh master --suppress=unassignedVariable
|
||||
|
||||
# Default options
|
||||
|
||||
This script suppresses warnings of the type "unusedStructMember" by default. If
|
||||
you want to get warnings about "unusedStructMembers" run the script with the
|
||||
--show-unused-struct option:
|
||||
./dist/tools/cppcheck/check.sh --show-unused-struct [BRANCH] [options to be passed]
|
||||
|
||||
# What to do about the findings
|
||||
|
||||
|
||||
15
dist/tools/cppcheck/check.sh
vendored
15
dist/tools/cppcheck/check.sh
vendored
@ -1,6 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
CHECKROOT=$(dirname "${0}")
|
||||
# Don't show warnings about unusedStructMembers by default
|
||||
DEFAULT_SUPPRESSIONS="${1}"
|
||||
if echo "${DEFAULT_SUPPRESSIONS}" | grep -q '^--show-unused-struct'; then
|
||||
DEFAULT_SUPPRESSIONS=""
|
||||
shift 1
|
||||
else
|
||||
DEFAULT_SUPPRESSIONS=--suppress="unusedStructMember"
|
||||
fi
|
||||
|
||||
BRANCH=${1}
|
||||
FILEREGEX='\.([sScHh]|cpp)$'
|
||||
|
||||
@ -33,6 +41,5 @@ if [ -z "${FILES}" ]; then
|
||||
fi
|
||||
|
||||
cppcheck --std=c99 --enable=style --force --error-exitcode=2 --quiet -j 8 \
|
||||
--inline-suppr --suppressions ${CHECKROOT}/vendor_suppressions.txt \
|
||||
--template "{file}:{line}: {severity} ({id}): {message}" \
|
||||
${@} ${FILES}
|
||||
--template "{file}:{line}: {severity} ({id}): {message}" \
|
||||
--inline-suppr ${DEFAULT_SUPPRESSIONS} ${@} ${FILES}
|
||||
|
||||
23
dist/tools/cppcheck/vendor_suppressions.txt
vendored
23
dist/tools/cppcheck/vendor_suppressions.txt
vendored
@ -1,23 +0,0 @@
|
||||
unusedStructMember:boards/chronos/drivers/include/display.h
|
||||
unusedStructMember:boards/x86-multiboot-common/include/multiboot.h
|
||||
unusedStructMember:cpu/atmega_common/avr-libc-extra/time.h
|
||||
unusedStructMember:cpu/cc2538/include/cc2538-gpio.h
|
||||
unusedStructMember:cpu/cc2538/include/cc2538-uart.h
|
||||
unusedStructMember:cpu/cc2538/include/gptimer.h
|
||||
unusedStructMember:cpu/cc2538/include/rfcore.h
|
||||
unusedStructMember:cpu/cc2538/include/soc-adc.h
|
||||
unusedStructMember:cpu/cortex-m0_common/include/core_*.h
|
||||
unusedStructMember:cpu/cortex-m3_common/include/core_*.h
|
||||
unusedStructMember:cpu/cortex-m4_common/include/core_*.h
|
||||
unusedStructMember:cpu/lpc1768/include/LPC17xx.h
|
||||
unusedStructMember:cpu/lpc1768/include/core_cm3.h
|
||||
unusedStructMember:cpu/sam3x8e/include/sam3x8e.h
|
||||
unusedStructMember:cpu/samd21/include/component/component_*.h
|
||||
unusedStructMember:cpu/samd21/include/samd21.h
|
||||
unusedStructMember:cpu/stm32f0/include/stm32f051x8.h
|
||||
unusedStructMember:cpu/stm32f1/include/stm32f10x.h
|
||||
unusedStructMember:cpu/stm32f3/include/stm32f303xc.h
|
||||
unusedStructMember:cpu/stm32f4/include/stm32f407xx.h
|
||||
unusedStructMember:cpu/stm32f4/include/stm32f415xx.h
|
||||
unusedStructMember:tests/unittests/embunit/embUnit/RepeatedTest.h
|
||||
unusedStructMember:tests/unittests/embunit/embUnit/Test*.h
|
||||
Loading…
x
Reference in New Issue
Block a user