From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by passt.top (Postfix) with ESMTPS id 945775A0274 for ; Fri, 29 Sep 2023 07:50:30 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1695966626; bh=JoUa9sQ6A99+8RXszcGuHdPCBwUa8FjcL0MULA62AiE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LLYUw1fL4ZZqTDBjjacPgmhlglXciYCu6po73PhEYnFOnTaGVRXWiLQbJOIv2UJom kWy8VWZJ3ciX6Cvi2xhFYjPUig9f/xN8Sjcu23Q/ZnRdJbMon7R8XlVAheHJtL+bOC mJTpLp0NxgLGhrCDH+fA4dHmCki85cd/jAWLQSso= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4RxfZp5wH9z4x5J; Fri, 29 Sep 2023 15:50:26 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 3/4] cppcheck: Use "exhaustive" level checking when available Date: Fri, 29 Sep 2023 15:50:21 +1000 Message-ID: <20230929055022.48624-4-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230929055022.48624-1-david@gibson.dropbear.id.au> References: <20230929055022.48624-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: YEJO2RWI4WIHYHG5F5TPAA3WKOEAGQTI X-Message-ID-Hash: YEJO2RWI4WIHYHG5F5TPAA3WKOEAGQTI X-MailFrom: dgibson@gandalf.ozlabs.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: David Gibson X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Recent enough cppcheck versions (at least as of cppcheck 2.12) give this error processing conf.c: conf.c:1179:1: information: ValueFlow analysis is limited in conf. Use --check-level=exhaustive if full analysis is wanted. [checkLevelNormal] Adding --check-level=exhaustive doesn't seem to significantly increase the cppcheck run time for us, so enable it when possible, suppressing that warning. Signed-off-by: David Gibson --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index af3bc75..941086a 100644 --- a/Makefile +++ b/Makefile @@ -278,6 +278,11 @@ clang-tidy: $(SRCS) $(HEADERS) -config='{CheckOptions: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: "false"}]}' \ --warnings-as-errors=* $(SRCS) -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) -DCLANG_TIDY_58992 +CPPCHECK_EXHAUSTIVE := +ifeq ($(shell cppcheck --check-level=exhaustive /dev/null > /dev/null 2>&1; echo $$?),0) + CPPCHECK_EXHAUSTIVE += --check-level=exhaustive +endif + SYSTEM_INCLUDES := /usr/include $(wildcard /usr/include/$(TARGET)) ifeq ($(shell $(CC) -v 2>&1 | grep -c "gcc version"),1) VER := $(shell $(CC) -dumpversion) @@ -286,6 +291,7 @@ endif cppcheck: $(SRCS) $(HEADERS) cppcheck --std=c11 --error-exitcode=1 --enable=all --force \ --inconclusive --library=posix --quiet \ + $(CPPCHECK_EXHAUSTIVE) \ $(SYSTEM_INCLUDES:%=-I%) \ $(SYSTEM_INCLUDES:%=--config-exclude=%) \ $(SYSTEM_INCLUDES:%=--suppress=*:%/*) \ -- 2.41.0