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 8D8A05A024D for ; Tue, 21 Mar 2023 04:55:07 +0100 (CET) Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4Pgd6H5DC5z4xFR; Tue, 21 Mar 2023 14:55:03 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1679370903; bh=ks6S83OPfsZlzrl8nEbJAh/5ltXfabADQbmQlNqzX0A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TQceFC47y91sCF6WGHPlBfJUvd9wkfidTlYrPf5Sv4TV67ysW/3GyE+D6AcuT8vCC FMg1ay+HyBm1XgJPQTJTWBDcZsBCKo8QuoySNfbDcWsVOFcPHcosGNGf2wjfdMvq/U 6bxWji+NCmRX7QAh0PbkAYNXqc1fbO0i/Nypp1CI= From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH 1/2] Work around weird false positives with cppcheck-2.9.1 Date: Tue, 21 Mar 2023 14:54:59 +1100 Message-Id: <20230321035500.732872-2-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230321035500.732872-1-david@gibson.dropbear.id.au> References: <20230321035500.732872-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: QBGJXAWV3MIKASQQRDJKHHIYWM7EIVJV X-Message-ID-Hash: QBGJXAWV3MIKASQQRDJKHHIYWM7EIVJV 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: Commit 89e38f55 "treewide: Fix header includes to build with musl" added extra #includes to work with musl. Unfortunately with the cppcheck version I'm using (cppcheck-2.9-1.fc37.x86_64 in Fedora 37) this causes weird false positives: specifically cppcheck seems to hit a #error in complaining about including it directly instead of via (which is not something we're doing). I have no idea why that would be happening; but I'm guessing it has to be a bug in the cpp implementation in that cppcheck version. In any case, it's possible to work around this by moving the include of before the include of . So, do that. Fixes: 89e38f55 Signed-off-by: David Gibson --- conf.c | 2 +- netlink.c | 2 +- tap.c | 2 +- tcp.c | 2 +- tcp_splice.c | 2 +- udp.c | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/conf.c b/conf.c index ce60432..04e9956 100644 --- a/conf.c +++ b/conf.c @@ -23,12 +23,12 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include #include diff --git a/netlink.c b/netlink.c index c8d39a1..00aa3e9 100644 --- a/netlink.c +++ b/netlink.c @@ -18,11 +18,11 @@ #include #include #include +#include #include #include #include #include -#include #include #include #include diff --git a/tap.c b/tap.c index 15fb52e..68ef480 100644 --- a/tap.c +++ b/tap.c @@ -14,6 +14,7 @@ */ #include +#include #include #include #include @@ -33,7 +34,6 @@ #include #include #include -#include #include #include #include diff --git a/tcp.c b/tcp.c index 0214087..8551416 100644 --- a/tcp.c +++ b/tcp.c @@ -267,6 +267,7 @@ #include #include #include +#include #include #include #include @@ -287,7 +288,6 @@ #include #include #include -#include #include #include /* For struct tcp_info */ diff --git a/tcp_splice.c b/tcp_splice.c index 6559762..5bfad2a 100644 --- a/tcp_splice.c +++ b/tcp_splice.c @@ -32,6 +32,7 @@ */ #include +#include #include #include #include @@ -40,7 +41,6 @@ #include #include #include -#include #include #include #include diff --git a/udp.c b/udp.c index b7bc4f3..70732fc 100644 --- a/udp.c +++ b/udp.c @@ -91,6 +91,7 @@ */ #include +#include #include #include #include @@ -107,7 +108,6 @@ #include #include #include -#include #include #include "checksum.h" -- 2.39.2