From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 626925A0298 for ; Mon, 13 May 2024 16:58:05 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202312; t=1715612280; bh=UcQyk/s32QDmmljzSGU2y7NRJHv9yRzZFYRx/fvYBEA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vjk1aeGkx8dTwBpCYCixvayQjlOUwHyPrt38trJ61bWQnDfFLpaauiq+uPxoD1vha ZRn6JsMFpmoCTkSQceJsKgUvv7GYe1OrLvePuVgSDJKuaDUrQmTKvRtFGAuKhBTzVS algagiM1Gp5rk0r0feK8s4PNovSafkS3cQNIhI+Cras/OE+fFdS1rYQcDwr83kYYJW w3KetJza1NWdKK53wWtEvBPgMD4QMiL13wb7XddOogJmB1l/GLJgX4SYB03BpgMbPK gDTaoQwmY9gOv/CEVIuNtoU+2XTWtfOcBXVir4MsPZuF1np09uGcXXCwfUqN8LcEO7 Eir4NyIQ7+e2w== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4VdMzr3C9Tz4x0y; Tue, 14 May 2024 00:58:00 +1000 (AEST) From: David Gibson To: passt-dev@passt.top, Stefano Brivio Subject: [PATCH v2 2/2] clang-tidy: Suppress macro to enum conversion warnings Date: Tue, 14 May 2024 00:57:58 +1000 Message-ID: <20240513145758.713647-3-david@gibson.dropbear.id.au> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240513145758.713647-1-david@gibson.dropbear.id.au> References: <20240513145758.713647-1-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: P3JJIOND3YNBYEEA6RUJ56M5W6EBUXJ4 X-Message-ID-Hash: P3JJIOND3YNBYEEA6RUJ56M5W6EBUXJ4 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 18.1.1 in Fedora 40 complains about every #define of an integral value, suggesting it be converted to an enum. Although that's certainly possible, it's of dubious value and results in some awkward arrangements on out codebase. Suppress it globally. Signed-off-by: David Gibson --- Makefile | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index c1e1f06..8ea1757 100644 --- a/Makefile +++ b/Makefile @@ -257,6 +257,12 @@ docs: README.md # 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 . +# +# - cppcoreguidelines-macro-to-enum +# Want to replace all #defines of integers with enums. Kind of +# makes sense when those defines form an enum-like set, but +# weird for cases like standalone constants, and causes other +# awkwardness for a bunch of cases we use clang-tidy: $(SRCS) $(HEADERS) clang-tidy -checks=*,-modernize-*,\ @@ -283,7 +289,8 @@ clang-tidy: $(SRCS) $(HEADERS) -altera-struct-pack-align,\ -concurrency-mt-unsafe,\ -readability-identifier-length,\ - -misc-include-cleaner \ + -misc-include-cleaner,\ + -cppcoreguidelines-macro-to-enum \ -config='{CheckOptions: [{key: bugprone-suspicious-string-compare.WarnOnImplicitComparison, value: "false"}]}' \ --warnings-as-errors=* $(SRCS) -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) -DCLANG_TIDY_58992 -- 2.45.0