Permalink
Browse files

Update cppcheck qa testing

cppcheck itself has changed in a couple of ways since the script
was last updated: The --force flag doesn't seem to work as
advertised (but --max-configs=999 does the job), and the names of
some suppressions have changed.  I've also added two new
suppressions for the use of readdir().
  • Loading branch information...
blblack committed Jan 11, 2018
1 parent e2e8eef commit e571ca0e3086457ad1e6f64061927b239b5dc56a
Showing with 5 additions and 3 deletions.
  1. +2 −2 libgdnsd/net.c
  2. +1 −1 qa/cppcheck.sh
  3. +1 −0 src/zscan_djb.c
  4. +1 −0 src/zsrc_rfc1035.c
View
@@ -46,13 +46,13 @@ void gdnsd_init_net(void) {
struct protoent* pe;
// cppcheck-suppress nonreentrantFunctionsgetprotobyname (init time, no threads)
// cppcheck-suppress getprotobynameCalled (init time, no threads)
pe = getprotobyname("tcp");
if(!pe)
log_fatal("getprotobyname('tcp') failed");
tcp_proto = pe->p_proto;
// cppcheck-suppress nonreentrantFunctionsgetprotobyname (init time, no threads)
// cppcheck-suppress getprotobynameCalled (init time, no threads)
pe = getprotobyname("udp");
if(!pe)
log_fatal("getprotobyname('udp') failed");
View
@@ -71,6 +71,6 @@ set -e
for plat in unix64 unix32; do
cppcheck -j4 --platform=$plat --std=c99 --std=posix \
--enable=warning,performance,portability,information,style,missingInclude \
--inline-suppr --force --quiet --error-exitcode=42 \
--inline-suppr --max-configs=999 --quiet --error-exitcode=42 \
$INCDIRS $SKIPFILES $DEFS .
done
View
@@ -529,6 +529,7 @@ static bool zscan_foreach_record(zscan_t *z, djb_recordcb_t cb) {
while(1) {
errno = 0;
// cppcheck-suppress readdirCalled
struct dirent* e = readdir(dir);
if(!e) {
if(errno)
View
@@ -481,6 +481,7 @@ static void scan_dir(struct ev_loop* loop, double initial_quiesce_time) {
struct dirent* result = NULL;
do {
errno = 0;
// cppcheck-suppress readdirCalled
result = readdir(zdhandle);
if(likely(result)) {
if(result->d_name[0] != '.')

0 comments on commit e571ca0

Please sign in to comment.