From 3c9c62fdca65c2e93014b3637dc73fa2b08a0e3f Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Sun, 4 Feb 2018 10:40:04 +0100 Subject: [PATCH] Fix most warnings from cppcheck 1.72 --- cppcheck-suppressions.txt | 2 +- dev.mk.in | 2 +- execute.c | 1 - lockfile.c | 3 +-- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/cppcheck-suppressions.txt b/cppcheck-suppressions.txt index 98310e241..6b1ce7f6e 100644 --- a/cppcheck-suppressions.txt +++ b/cppcheck-suppressions.txt @@ -1,3 +1,3 @@ ConfigurationNotChecked missingIncludeSystem -unusedFunction:test/test_* +unusedFunction:unittest/test_* diff --git a/dev.mk.in b/dev.mk.in index 3254bd5a7..6c348701e 100644 --- a/dev.mk.in +++ b/dev.mk.in @@ -157,7 +157,7 @@ check-syntax: .PHONY: cppcheck cppcheck: $(CPPCHECK) --suppressions-list=$(CPPCHECK_SUPPRESSIONS) \ - --inline-suppr -q --enable=all \ + --inline-suppr -q --enable=all --force \ $(non_3pp_sources) main.c $(test_sources) .PHONY: uncrustify diff --git a/execute.c b/execute.c index da3e6f09b..6579b3026 100644 --- a/execute.c +++ b/execute.c @@ -79,7 +79,6 @@ win32argvtos(char *prefix, char **argv) } *ptr++ = '"'; *ptr++ = ' '; - // cppcheck-suppress unreadVariable } while ((arg = argv[i++])); ptr[-1] = '\0'; diff --git a/lockfile.c b/lockfile.c index ce3dcf4aa..9d1a49db2 100644 --- a/lockfile.c +++ b/lockfile.c @@ -1,4 +1,4 @@ -// Copyright (C) 2010-2016 Joel Rosdahl +// Copyright (C) 2010-2018 Joel Rosdahl // // This program is free software; you can redistribute it and/or modify it // under the terms of the GNU General Public License as published by the Free @@ -119,7 +119,6 @@ lockfile_acquire(const char *path, unsigned staleness_limit) } free(content); content = x_readlink(lockfile); - // cppcheck-suppress nullPointer - false positive if (!content) { if (errno == ENOENT) { // The symlink was removed after the symlink() call above, so retry -- 2.47.2