From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from gandalf.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 211AC5A026F for ; Wed, 15 Nov 2023 03:59:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=201602; t=1700017189; bh=NNILyIYzM/kzb9L2KupZF5A/u3DBhw1hUx+57YHLpv4=; h=From:To:Cc:Subject:Date:From; b=Op4UrOtkWuirniGUk+EFSOxQlRmfBpPSL1r1wm6rDkVuD4lN3ns5YGWeyHU0WD+dK zs+WG8amyjCuIhFe9u0O5NHEI2VmtnGFlqc+sBB5Hee+5/vD4xXPz3YoCSriwlSjjv EjeJdYCmZJsLpPgfu3shdbd77okbGo4nNtXuuiw8= Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4SVSZF14R3z4x5m; Wed, 15 Nov 2023 13:59:49 +1100 (AEDT) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH] clang-tidy: Suppress silly misc-include-cleaner warnings Date: Wed, 15 Nov 2023 13:59:45 +1100 Message-ID: <20231115025945.443578-1-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: GZWUXH7D4DSIJYALAOM3H3FT4ZKBYT7M X-Message-ID-Hash: GZWUXH7D4DSIJYALAOM3H3FT4ZKBYT7M 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: clang-tidy from LLVM 17.0.3 (which is in Fedora 39) includes a new "misc-include-cleaner" warning that tries to make sure that headers *directly* provide the things that are used in the .c file. That sounds great in theory but is in practice unusable: Quite a few common things in the standard library are ultimately provided by OS-specific system headers, but for portability should be accessed via closer-to-standardised library headers. This will warn constantly about such cases: e.g. it will want you to include instead of to get PATH_MAX. So, suppress this warning globally in the Makefile. Signed-off-by: David Gibson --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 743c123..ff21459 100644 --- a/Makefile +++ b/Makefile @@ -250,6 +250,12 @@ docs: README.md # - bugprone-assignment-in-if-condition # Dubious value over the compiler's built-in warning. Would # increase verbosity. +# +# - misc-include-cleaner +# Wants to include headers which *directly* provide the things +# we use. That sounds nice, but means it will often want a OS +# specific header instead of a mostly standard one, such as +# instead of . clang-tidy: $(SRCS) $(HEADERS) clang-tidy -checks=*,-modernize-*,\ @@ -275,7 +281,8 @@ clang-tidy: $(SRCS) $(HEADERS) -readability-function-cognitive-complexity,\ -altera-struct-pack-align,\ -concurrency-mt-unsafe,\ - -readability-identifier-length \ + -readability-identifier-length,\ + -misc-include-cleaner \ -config='{CheckOptions: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: "false"}]}' \ --warnings-as-errors=* $(SRCS) -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) -DCLANG_TIDY_58992 -- 2.41.0