From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: passt.top; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=SV50/eWP; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by passt.top (Postfix) with ESMTPS id 5F7325A0262 for ; Tue, 05 May 2026 12:21:00 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777976459; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=SLgRDbyGtCoWptoIkE6qJnq5rVb/yUVPzz6mFP0QaCo=; b=SV50/eWPev88cTSmnWKKnhW6Cn7uc/AwpIHQyqaszsvTq3gBwqnvPPdNjHKOX7APbQsSF5 7cLbbI71xh2dXy3bmN/Cw/Ypa5NNGDMoDhNxaefErUp6o5nBhQhHGqUJUg8OX1IiEGpo+z 6NDUdY+VANr4Y7/7BvwFVi/oH8gsXus= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-529-5yPjbBXmOCutkcUGlG5juQ-1; Tue, 05 May 2026 06:20:57 -0400 X-MC-Unique: 5yPjbBXmOCutkcUGlG5juQ-1 X-Mimecast-MFC-AGG-ID: 5yPjbBXmOCutkcUGlG5juQ_1777976456 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-4497a0e3acaso3704144f8f.0 for ; Tue, 05 May 2026 03:20:56 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777976456; x=1778581256; h=date:content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=SLgRDbyGtCoWptoIkE6qJnq5rVb/yUVPzz6mFP0QaCo=; b=f5mUWaERK7VJJH4XIiow3JegunqpMsTpwlEfkUtYglw3IcQYZkHY4TBuu8Bv+pelEh DzaXN8/NUe9HxEOZsCwGBqxY9bv2wN1p8zeZfeVM6G/uHuPfeuWqL94rlKiApDDbXgIR THv1HJ6um4YHOXNoUhHcuv+045njrJ6lhHgF8Eu4OT+Iki5pJuHxDk3snJCiHzo8P3Cy OPeaDB3lgHB3G4AlU2DlMELrzATdx6eibtNoZvcX4rpQYxFczxc7w536Lc6Kdl5rRTiu kA4GBn3wkQTW/e9apSapBLwn92P3rbijk7sbOi/RkuoKgeGMIWKt8GxkhUTBRcjvY2eP qtWQ== X-Forwarded-Encrypted: i=1; AFNElJ82ttlMntb/JaTCqyHO9y7AXkl9dAsRNRqUHRp56fkbJhYDR3b9zl/ycMckjPYU3AbrmynfXMjrEqM=@passt.top X-Gm-Message-State: AOJu0YwJK0y7eqV1XQbYIKPzTddnAgcEAMUuFx0fJ663W5Oce84v14MK 0pY0JVEaAsSxbPjzOMVPr7A+ytvpRZSsFbzHFRLI/2E1M/+qVbFCq4NK2woswu/Zp+q/RezIS4x 2iBkWvXu9Dtb9eDEbraecF4Z98eoEEA790rWRsAOU8jqc6nNCkAw1IQ== X-Gm-Gg: AeBDietRgzNlBx4pu7TJvTqQeYfh5QsMA7wGvDV1nQyZ3LIpq11laLuXGRvv9/fD9s9 AvyT6+4bPGhWeRbE6M5aSfJICAxeMSg32PmnuXk5ZjrO7aRyqdsDqfFZcGmD8emZyEO/qfa7MUi H6nkZMfi3tBOMO1aCdHMfSOQS6pux33ag43SFfBxwE2DAHyl9K4fZjRkx7zJ31/+p6o8240AYrJ R6N3J8CadoPaLupk8wUcaOuuJuKMvAtnnCcFfxfefzNaa3wroRB2SYLmyQJ8VdbhbKJdCxIrpdZ MQwraaOwKt6+lp1PIjgjwVs9eEXGbYdLA0uxO3jqDcdaIJ5zV448lobIFSJRi/prvSdOjld4zYE 09CdAYw30kwznqNLSFnLSAcvS4dF6kdjZaP4UPBDh2s4= X-Received: by 2002:a05:6000:2501:b0:43d:26a2:f8c3 with SMTP id ffacd0b85a97d-44bb65dfc4dmr22998686f8f.35.1777976455459; Tue, 05 May 2026 03:20:55 -0700 (PDT) X-Received: by 2002:a05:6000:2501:b0:43d:26a2:f8c3 with SMTP id ffacd0b85a97d-44bb65dfc4dmr22998619f8f.35.1777976454840; Tue, 05 May 2026 03:20:54 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45054b03e04sm3738111f8f.21.2026.05.05.03.20.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 03:20:53 -0700 (PDT) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v2 01/13] Makefile: Use make variables for static checker configuration Message-ID: <20260505122048.2982126f@elisabeth> In-Reply-To: References: <20260421032338.1909084-1-david@gibson.dropbear.id.au> <20260421032338.1909084-2-david@gibson.dropbear.id.au> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.49; x86_64-pc-linux-gnu) MIME-Version: 1.0 Date: Tue, 05 May 2026 12:20:49 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: Y_UNvprOIiQWSkRBIzW7ip3UOGIr7oKSCenqUr8BOqQ_1777976456 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: FIQQO27XTA5IVFXL64E2PJSN4BOJRWEC X-Message-ID-Hash: FIQQO27XTA5IVFXL64E2PJSN4BOJRWEC X-MailFrom: sbrivio@redhat.com 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 , passt-dev@passt.top 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: On Tue, 5 May 2026 12:14:02 +0200 Laurent Vivier wrote: > On 4/21/26 05:23, David Gibson wrote: > > Our cppcheck and clang-tidy rules don't really follow normal Makefile > > conventions. Usually any commands other than the very basics have their > > binary specified in a variable so it can be overridden on the command line > > if they're in an unusual location. Implement that for $(CPPCHECK) and > > $(CLANG_TIDY) > > > > Likewise flags to tools usually have their own Make variable. Do the same > > with $(CLANG_TIDY_FLAGS) and $(CPPCHECK_FLAGS). Note that these only have > > the options specifically for the static checker, not compiler flags which > > we are also supplying to the static checker - those are derived from > > FLAGS / CFLAGS / CPPFLAGS as before. > > > > As part of that we change the probing for --check-level=exhaustive from > > being run as part of the cppcheck target, to being run when we build the > > CPPCHECK_FLAGS variable. That doesn't make any real difference now, but > > will make things nicer if we need multiple cppcheck targets in future (e.g. > > for passt-repair). > > > > Signed-off-by: David Gibson > > --- > > Makefile | 32 +++++++++++++++++++------------- > > 1 file changed, 19 insertions(+), 13 deletions(-) > > > > diff --git a/Makefile b/Makefile > > index f697c12b..17e70d22 100644 > > --- a/Makefile > > +++ b/Makefile > > @@ -174,21 +174,27 @@ docs: README.md > > done < README.md; \ > > ) > README.plain.md > > > > +CLANG_TIDY = clang-tidy > > +CLANG_TIDY_FLAGS = -DCLANG_TIDY_58992 > > + > > clang-tidy: $(PASST_SRCS) > > - clang-tidy $^ -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) \ > > - -DCLANG_TIDY_58992 > > + $(CLANG_TIDY) $^ -- $(filter-out -pie,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) \ > > + $(CLANG_TIDY_FLAGS) > > > > -cppcheck: $(PASST_SRCS) $(HEADERS) > > - if cppcheck --check-level=exhaustive /dev/null > /dev/null 2>&1; then \ > > - CPPCHECK_EXHAUSTIVE="--check-level=exhaustive"; \ > > - else \ > > - CPPCHECK_EXHAUSTIVE=; \ > > - fi; \ > > - cppcheck --std=c11 --error-exitcode=1 --enable=all --force \ > > +CPPCHECK = cppcheck > > +CPPCHECK_FLAGS = --std=c11 --error-exitcode=1 --enable=all --force \ > > --inconclusive --library=posix --quiet \ > > - $${CPPCHECK_EXHAUSTIVE} \ > > --inline-suppr \ > > - --suppress=missingIncludeSystem \ > > + $(shell if $(CPPCHECK) --quiet --check-level=exhaustive /dev/null; then \ > > + echo "--check-level=exhaustive"; \ > > + else \ > > + echo ""; \ > > + fi) > > Perhaps we can add a reusable function to check flags: > > check_flag = $(shell $(1) $(2) >/dev/null 2>&1 && echo $(2)) > > Then > $(call check_flag, $(CPPCHECK) /dev/null, --check-level=exhaustive) > \ > > + --suppress=missingIncludeSystem \ > > --suppress=unusedStructMember \ > > - $(filter -D%,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) -D CPPCHECK_6936 \ > > - $^ > > + -D CPPCHECK_6936 > > + > > +cppcheck: $(PASST_SRCS) $(HEADERS) > > + $(CPPCHECK) $(CPPCHECK_FLAGS) \ > > + $(filter -D%,$(FLAGS) $(CFLAGS) $(CPPFLAGS)) $^ \ > > + $^ > > You have duplicate '$^' here. Just note that it's not necessarily important to review this series right now (I'm not sure). I guess if we can "fix" it (see my concerns about 4/13) quickly, then it's useful, and I'll try to pick it up like that (feel free to post a new version yourself, of course!). But if it needs major reworks I'd rather try to come up with something minimal instead, for the moment. -- Stefano