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=PgpcgHXB; 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 B75325A0262 for ; Tue, 05 May 2026 15:14:55 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1777986894; 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=fjmk0AVWGXS6TpiP2qHcAOSGUOuJfCNv8+RdBlybHis=; b=PgpcgHXBKFljwZtZzCtdkTWVFIuUwiYcERseu9iRexAbz1TbEnuPNhMDFFIBOEjyw6ychI 6A3+GzPw6NZB6QyI7zjYsza9VEPjhRbw35ib63h20215bzBwisjAgyABlVbNHyTOesZ3BG /qVbIYDGdw+iLIOjEO9GbAf39tCK7Rs= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-445-Upu-VOI4MvWxXtOIyWUwnA-1; Tue, 05 May 2026 09:14:53 -0400 X-MC-Unique: Upu-VOI4MvWxXtOIyWUwnA-1 X-Mimecast-MFC-AGG-ID: Upu-VOI4MvWxXtOIyWUwnA_1777986892 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-488bd1ee9e7so54215775e9.1 for ; Tue, 05 May 2026 06:14:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777986892; x=1778591692; 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=fjmk0AVWGXS6TpiP2qHcAOSGUOuJfCNv8+RdBlybHis=; b=ccqJsHeKUvqQy1gCUAMbOSwN452WfTmiPvhRFjkCla2B2LIFHKq+xLDFobd7rW94EW NA3/tkmamDKMQXwtHot4Thlvu1YU3a3ErWeBvLBF3NZR4jKwYe8tfXhJDy9zSyKMDQHp VmupQzg7J+pGUePQoxq50QpuxmBzbBWUPtReWZIO01hrtL6j8+SoHpcX48mzSa7p7eFn rHUd94skouX4ZiRN9Vgw0OTJRE8x+eJblSHfhdG7WsylfDerEEZ0ZRKnvkmPDaVpNKnc Awdx4m5AvgG3Yxubvbt8DHs4jpy5InnuLb4tujSrsWTCtCTXWR9iZCOyQ2HOQXtO7vRk H2+g== X-Forwarded-Encrypted: i=1; AFNElJ+7Q80qoNEf0eL25zkQaaPbxjYIeKzg5Qnrl4dbcvtAbVud/tiiWPkAt3efOazRivVHYA65kYBt7Ik=@passt.top X-Gm-Message-State: AOJu0YxO7hAALCl8ygjLeW0H6VST/KB77Vk9x5pYc2oT7Ahn8d5KLUxg 7qfXyoW/q+PYvEDYVqqLPLkP5OQou8W+OT+7kPP7Atw5+YZYCYfKQ+u2ehDx/nxdJbqUjvf3XrW Y3aS8WZY9a8fPF8lpZLSk3pxjzNC9lubn5/OVVnqG9Al027RhXwQ/Sg== X-Gm-Gg: AeBDieviD6BKJ3o6ZfLglgUqGqdGZEV+rcfiGg3AvyJ5QG7bKjA2xlmBlKqEOurR+3X HgCUW+fQ9X787o+JRQoHaFgPGBQ7qQWkHMr4priw9ypZyKkaxJpOPz1O9BBLtLLt5T5hO9QgAQK 99BQMS58N85CH5+r3F59SGc8BZXU3tGsIlM2O+kJkMcuZxhA//6waDyABWP5kDj05999nydSbjq 4DI77Ek8/PNyRGel/j3ysw2Wsl2+Q2Lo7PgmWn20xGlPzpfJwvRJ4whIyxXFJtcA5N5jIk2lgq7 g2TUEif5rX5Yf4EUczHGGA22+uk8p42aYVDrs9kB83vmAt/rLI9e6+LoKJWzk7rhBEdYP88C/bE uhldGtkEqD2NZR6xGatZsFcaz4j+NZ/h7D+Rblm8F/VU= X-Received: by 2002:a05:600c:c119:b0:488:bc6a:528d with SMTP id 5b1f17b1804b1-48a9866cdd9mr190917075e9.22.1777986892140; Tue, 05 May 2026 06:14:52 -0700 (PDT) X-Received: by 2002:a05:600c:c119:b0:488:bc6a:528d with SMTP id 5b1f17b1804b1-48a9866cdd9mr190916465e9.22.1777986891544; Tue, 05 May 2026 06:14:51 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-48d1771fdf7sm27364665e9.5.2026.05.05.06.14.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 May 2026 06:14:50 -0700 (PDT) From: Stefano Brivio To: Laurent Vivier Subject: Re: [PATCH v2 01/13] Makefile: Use make variables for static checker configuration Message-ID: <20260505151448.27dafb26@elisabeth> In-Reply-To: <945d5ad2-a900-4a43-bb80-f45e99747f20@redhat.com> References: <20260421032338.1909084-1-david@gibson.dropbear.id.au> <20260421032338.1909084-2-david@gibson.dropbear.id.au> <20260505122048.2982126f@elisabeth> <945d5ad2-a900-4a43-bb80-f45e99747f20@redhat.com> 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 15:14:49 +0200 (CEST) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: JjO9DHNEGL8E1LDGEQUjlt7Ewu0QVgVJHIYoKswtmFM_1777986892 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: AHZBB2KCFUKU3B5ROH33H5FEZHVUB7XM X-Message-ID-Hash: AHZBB2KCFUKU3B5ROH33H5FEZHVUB7XM 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:49:11 +0200 Laurent Vivier wrote: > On 5/5/26 12:20, Stefano Brivio wrote: > > 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). > > okay, I was reviewing it because "Dynamic configuration" series doesn't apply cleanly > without it. Yes, absolutely, and we can't run static checkers on pesto without it, so we need something like this series. If we (especially: you ;)) can fix whatever comment you have plus my concern on 4/13 quickly enough, it makes sense to continue with it. If it becomes a big effort maybe we should go for a less involved approach though. I'm not sure. -- Stefano