diff --git a/cppcheck.sh b/cppcheck.sh index 2bb9e3719..ac514cccc 100755 --- a/cppcheck.sh +++ b/cppcheck.sh @@ -9,4 +9,5 @@ echo "This takes several hours to run" 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 HAVE_CONFIG_H -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 -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 -D HAVE_SIGNAL" -cppcheck --inline-suppr -I src -I include --include=include/config.h --include=include/hamlib/rig.h -q --force --enable=all --std=c99 $SUPPRESS $CHECK . &>cppcheck.log +#cppcheck --inline-suppr -I src -I include --include=include/config.h --include=include/hamlib/rig.h -q --force --enable=all --std=c99 $SUPPRESS $CHECK . &>cppcheck.log +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 diff --git a/include/hamlib/rig.h b/include/hamlib/rig.h index 09d0a3a12..ef9350e53 100644 --- a/include/hamlib/rig.h +++ b/include/hamlib/rig.h @@ -24,9 +24,13 @@ #ifndef _RIG_H #define _RIG_H 1 +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include /* Rig list is in a separate file so as not to mess up w/ this one */ @@ -2678,6 +2682,7 @@ extern HAMLIB_EXPORT(void) rig_no_restore_ai(); extern HAMLIB_EXPORT(int) rig_get_cache_timeout_ms(RIG *rig, cache_t selection); extern HAMLIB_EXPORT(int) rig_set_cache_timeout_ms(RIG *rig, cache_t selection, int ms); +// cppcheck-suppress * #include extern HAMLIB_EXPORT(int) hl_usleep(useconds_t msec); diff --git a/scripts/build-w32.sh b/scripts/build-w32.sh old mode 100644 new mode 100755 diff --git a/scripts/build-w64.sh b/scripts/build-w64.sh old mode 100644 new mode 100755 diff --git a/src/idx_builtin.h b/src/idx_builtin.h index ba155926e..cec1f34ed 100644 --- a/src/idx_builtin.h +++ b/src/idx_builtin.h @@ -39,7 +39,7 @@ // Note that 1<<0 is satisfied by the last clause here == 0 // This is future-proofed for 63 levels -#define setting2idx_builtin(s) ( \ +#define setting2idx_builtin(s) (( \ (s)==(1ull<<1)?1: \ (s)==(1ull<<2)?2: \ (s)==(1ull<<3)?3: \ @@ -103,7 +103,7 @@ (s)==(1ull<<61)?61: \ (s)==(1ull<<62)?62: \ (s)==(1ull<<63)?63: \ - 0 \ + 0) \ ) #define LVL_PREAMP setting2idx_builtin(RIG_LEVEL_PREAMP) diff --git a/src/iofunc.h b/src/iofunc.h index b423fed34..a1edbdff9 100644 --- a/src/iofunc.h +++ b/src/iofunc.h @@ -21,7 +21,8 @@ #ifndef _IOFUNC_H #define _IOFUNC_H 1 - + +// cppcheck-suppress * #include #include diff --git a/src/misc.h b/src/misc.h index b39902dbc..f75ba2468 100644 --- a/src/misc.h +++ b/src/misc.h @@ -84,10 +84,12 @@ extern int no_restore_ai; /* needs config.h included beforehand in .c file */ #ifdef HAVE_INTTYPES_H +// cppcheck-suppress * # include #endif #ifdef HAVE_SYS_TIME_H +// cppcheck-suppress * # include #endif diff --git a/tests/rigctl_parse.h b/tests/rigctl_parse.h index a741742f2..873f9adae 100644 --- a/tests/rigctl_parse.h +++ b/tests/rigctl_parse.h @@ -25,6 +25,7 @@ #ifndef RIGCTL_PARSE_H #define RIGCTL_PARSE_H +// cppcheck-suppress * #include #include diff --git a/tests/rigctlcom.c b/tests/rigctlcom.c index 60539853a..37303a8f0 100644 --- a/tests/rigctlcom.c +++ b/tests/rigctlcom.c @@ -33,30 +33,43 @@ #ifdef WIN32 #define WIN32_LEAN_AND_MEAN +// cppcheck-suppress * #include #endif +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include +// cppcheck-suppress * #include #ifdef HAVE_NETINET_IN_H +// cppcheck-suppress * # include #endif #ifdef HAVE_ARPA_INET_H +// cppcheck-suppress * # include #endif #ifdef HAVE_SYS_SOCKET_H +// cppcheck-suppress * # include #elif HAVE_WS2TCPIP_H # include @@ -722,9 +735,7 @@ static int handle_ts2000(void *arg) int p15 = 0; // P15 Shift status dummy value for now int retval = rig_get_freq(my_rig, RIG_VFO_A, &freq); char response[64]; - // cppcheck-suppress * - char *fmt = - "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; + char *fmt = "IF%011"PRIll"%04d+%05d%1d%1d%1d%02d%1d%1"PRIll"%1d%1d%1d%1d%02d%1d;"; if (retval != RIG_OK) {