2020-05-22 12:36:24 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-01-16 05:03:12 +00:00
|
|
|
# Author Michael Black W9MDB
|
|
|
|
# This SUPPRESS setting results in no warnings as of 2020-01-14
|
Fix spelling errors
Fixed using the following command:
codespell --write-changes --summary --skip=*.m4 --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
codespell --write-changes --summary --skip=aclocal.m4,lib --ignore-words-list="develope,get's,quitt,setts,som,ue,vektor"
Codespell home page: https://github.com/codespell-project/codespell
2020-07-24 07:02:12 +00:00
|
|
|
# There are things that could still be done...especially in the C++ area
|
2020-09-06 20:03:40 +00:00
|
|
|
echo "Ideally there should be no errors or warnings"
|
2020-05-22 12:36:24 +00:00
|
|
|
|
2020-01-16 05:03:12 +00:00
|
|
|
# We do suppress some errors which are expected or other code
|
|
|
|
# There are quite a few C++ items to take care of still if anybody cares
|
2020-05-22 12:36:24 +00:00
|
|
|
SUPPRESS="\
|
|
|
|
-i c++/rigclass.cc \
|
|
|
|
-i c++/rotclass.cc \
|
|
|
|
-i c++/ampclass.cc \
|
|
|
|
-i bindings \
|
|
|
|
-i lib/getopt.c \
|
|
|
|
-i lib/getopt_long.c \
|
|
|
|
--suppress=*:extra/gnuradio/demod.h \
|
|
|
|
--suppress=*:extra/gnuradio/HrAGC.h \
|
|
|
|
--suppress=*:extra/gnuradio/nfm.h \
|
|
|
|
--suppress=*:extra/gnuradio/am.h \
|
|
|
|
--suppress=*:extra/gnuradio/ssb.h \
|
|
|
|
--suppress=*:extra/gnuradio/wfm.h \
|
|
|
|
--suppress=*:extra/gnuradio/wfm.h \
|
|
|
|
--suppress=*:extra/gnuradio/HrAGC.h \
|
|
|
|
--suppress=knownConditionTrueFalse:tests/rotctl.c \
|
|
|
|
--suppress=knownConditionTrueFalse:tests/rigctl.c \
|
|
|
|
--suppress=knownConditionTrueFalse:tests/ampctl.c \
|
|
|
|
--suppress=knownConditionTrueFalse:tests/rotctl_parse.c \
|
|
|
|
--suppress=knownConditionTrueFalse:tests/rigctl_parse.c \
|
|
|
|
--suppress=knownConditionTrueFalse:tests/ampctl_parse.c"
|
|
|
|
|
|
|
|
#CHECK="\
|
|
|
|
#-D RIG_LEVEL_LINEOUT=1 \
|
|
|
|
#-D SIGPIPE \
|
|
|
|
#-D SIGINT \
|
|
|
|
# -D IPV6_V6ONLY \
|
|
|
|
# -D RIG_MODE_WFM \
|
|
|
|
# -D ABI_VERSION=4 \
|
|
|
|
# -D F_SETSIG=1 \
|
|
|
|
# -U O_ASYNC \
|
|
|
|
# -U SA_SIGINFO \
|
|
|
|
# -U HASH_BLOOM \
|
|
|
|
# -U HASH_EMIT_KEYS \
|
|
|
|
# -U HASH_FUNCTION \
|
|
|
|
# -U __USEP5P6__"
|
|
|
|
|
|
|
|
CHECK="\
|
|
|
|
-Duint64_t \
|
|
|
|
-D HAMLIB_EXPORT \
|
|
|
|
-D HAMLIB_EXPORT_VAR \
|
|
|
|
-D __WORDSIZE \
|
|
|
|
-D BACKEND_EXPORT \
|
|
|
|
-D PRId64 \
|
|
|
|
-D DECLARE_INITRIG_BACKEND \
|
|
|
|
-D DECLARE_INITRROT_BACKEND \
|
|
|
|
-D DECLARE_INITAMP_BACKEND \
|
2020-09-19 21:09:44 +00:00
|
|
|
-D B230400
|
2020-05-22 12:36:24 +00:00
|
|
|
-U RIG_LEVEL_LINEOUT \
|
|
|
|
-U O_ASYNC \
|
|
|
|
-U F_SETSIG \
|
|
|
|
-U SA_SIGINFO \
|
|
|
|
-U SIGPIPE \
|
|
|
|
-U gai_strerror \
|
|
|
|
-U CMSPAR \
|
|
|
|
-U TIOCCBRK \
|
|
|
|
-U TIOCSBRK \
|
|
|
|
-U TIOCMBIC \
|
|
|
|
-U TIOCMBIS \
|
|
|
|
-U HASH_BLOOM \
|
|
|
|
-U HASH_EMIT_KEYS \
|
|
|
|
-U HASH_FUNCTION \
|
|
|
|
-U IPV6_V6ONLY \
|
|
|
|
-D SIGINT \
|
|
|
|
-D WIN32 \
|
2021-09-15 15:27:34 +00:00
|
|
|
-D CLOCK_REALTIME \
|
2020-05-22 12:36:24 +00:00
|
|
|
-D HAVE_SIGNAL"
|
|
|
|
|
|
|
|
# If no directory or file name provided, scan the entire project.
|
|
|
|
if test $# -eq 0 ; then
|
2020-09-06 17:41:43 +00:00
|
|
|
echo "See cppcheck.log when done"
|
|
|
|
echo "This takes a while to run"
|
2021-12-13 19:18:48 +00:00
|
|
|
cppcheck --inline-suppr \
|
2020-05-22 12:36:24 +00:00
|
|
|
-I src \
|
|
|
|
-I include \
|
|
|
|
--include=include/config.h \
|
|
|
|
--include=include/hamlib/rig.h \
|
|
|
|
-q \
|
|
|
|
--force \
|
|
|
|
--enable=all \
|
|
|
|
--std=c99 \
|
|
|
|
$SUPPRESS \
|
|
|
|
$CHECK \
|
|
|
|
. \
|
|
|
|
>cppcheck.log 2>&1
|
2020-05-05 16:32:01 +00:00
|
|
|
else
|
2020-05-22 12:36:24 +00:00
|
|
|
cppcheck --check-config \
|
|
|
|
--inline-suppr \
|
|
|
|
-I src \
|
|
|
|
-I include \
|
|
|
|
--include=include/config.h \
|
|
|
|
--include=include/hamlib/rig.h \
|
|
|
|
-q \
|
|
|
|
--force \
|
|
|
|
--enable=all \
|
|
|
|
--std=c99 \
|
|
|
|
$SUPPRESS \
|
|
|
|
$CHECK \
|
|
|
|
$1
|
2020-05-05 16:32:01 +00:00
|
|
|
fi
|