From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=fail (p=quarantine dis=none) header.from=redhat.com 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 9BB515A0271 for ; Fri, 20 Nov 2026 02:32:58 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1795138377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=fVFIzmx21WkyJUkLSdiUp7VgiFwHBuWS+4KhN1dl3X8=; b=JdZp2UUq9S2vvM6fHfoXuQnYb0Hbas8ATSsoWnhsvw7lkByYft9pJoSDMER/pXiNz2SJMD IQ9E4pQDPQ45VwJbH+cDEofhTHCk6uVzd24tPJT7EBmV1WreKu20M7E03ZolSHOjf1zr9i G4wKPlh5+aXPn25XheOIEfFeJ/DiylU= Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-221-J2x2nB8dPHe_QYMBE5jlXA-1; Fri, 20 Nov 2026 01:32:53 +0000 X-MC-Unique: J2x2nB8dPHe_QYMBE5jlXA-1 X-Mimecast-MFC-AGG-ID: J2x2nB8dPHe_QYMBE5jlXA_1795138372 Received: from mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.111]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 872751956072; Fri, 20 Nov 2026 01:32:52 +0000 (UTC) Received: from jmaloy-thinkpadp16vgen1.redhat.corp (headnet04.pony-001.prod.iad2.dc.redhat.com [10.2.32.116]) by mx-prod-int-08.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id B91D21800543; Fri, 20 Nov 2026 01:32:51 +0000 (UTC) From: Jon Maloy To: sbrivio@redhat.com, david@gibson.dropbear.id.au, jmaloy@redhat.com, passt-dev@passt.top Subject: [PATCH 2/3] clang-tidy: Disable checks new in clang-tidy 23 Date: Thu, 19 Nov 2026 20:32:47 -0500 Message-ID: <20261120013248.1472649-3-jmaloy@redhat.com> In-Reply-To: <20261120013248.1472649-1-jmaloy@redhat.com> References: <20261120013248.1472649-1-jmaloy@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.111 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: opi9AuvZ1FrLBze2QPrID_t7aEW5YxZL2U0DPHpy6ZU_1795138372 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit content-type: text/plain; charset="US-ASCII"; x-default=true Message-ID-Hash: RK6T56OW7QBWGVNMV4WF5UJ7RCP72UXF X-Message-ID-Hash: RK6T56OW7QBWGVNMV4WF5UJ7RCP72UXF X-MailFrom: jmaloy@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 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 23 introduces three new checks, which make 'make clang-tidy' fail on code that's otherwise fine: - readability-trailing-comma wants a trailing comma in every multi-line initialiser list, and none in single-line ones. That's not part of our coding style, and it reports about 30 sites (dhcpv6.c, ndp.c, netlink.c, pcap.c, tap.c, ...) - readability-redundant-nested-if wants nested if statements merged into a single condition, also where the inner condition has side effects, as in bind() or setsockopt() calls, or a dedicated comment (util.c, tcp.c, ...). Merging those would hurt readability, much like the braces-around-statements checks we already disable - bugprone-assignment-in-selection-statement, which cert-exp45-c is now an alias of, reports assignments in conditions (conf.c, flow.c, udp.c), like bugprone-assignment-in-if-condition, which we already disable for the same reasons Disable these checks. Signed-off-by: Jon Maloy --- .clang-tidy | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.clang-tidy b/.clang-tidy index ec570f2d..6aceb44a 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -9,8 +9,11 @@ Checks: - "-cppcoreguidelines-init-variables" # Dubious value over the compiler's built-in warning. Would - # increase verbosity. + # increase verbosity. Same for its broader variant, added in + # clang-tidy 23, also known as cert-exp45-c - "-bugprone-assignment-in-if-condition" + - "-bugprone-assignment-in-selection-statement" + - "-cert-exp45-c" # Debatable whether these improve readability, right now it would look # like a mess @@ -99,6 +102,15 @@ Checks: # be treated directly as a bool. - "-readability-implicit-bool-conversion" + # Wants trailing commas in multi-line initialiser lists, and none in + # single-line ones. Not part of our coding style, and enforcing it + # would mean churn all over the place for no practical benefit. + - "-readability-trailing-comma" + + # Merging nested if statements would often hurt readability, e.g. + # where the inner condition has side effects or a separate comment. + - "-readability-redundant-nested-if" + WarningsAsErrors: "*" HeaderFileExtensions: - h -- 2.56.1