From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=pass (p=none dis=none) header.from=fastmail.com Authentication-Results: passt.top; dkim=pass (2048-bit key; unprotected) header.d=fastmail.com header.i=@fastmail.com header.a=rsa-sha256 header.s=fm3 header.b=OoNhtQqQ; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.a=rsa-sha256 header.s=fm3 header.b=SCrmscO0; dkim-atps=neutral Received: from fhigh-b8-smtp.messagingengine.com (fhigh-b8-smtp.messagingengine.com [202.12.124.159]) by passt.top (Postfix) with ESMTPS id EBCA55A0269 for ; Fri, 15 May 2026 13:05:55 +0200 (CEST) Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 5DC657A0075; Fri, 15 May 2026 07:05:54 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Fri, 15 May 2026 07:05:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1778843154; x=1778929554; bh=h6saPr12tt FQFxvyAJRTAG2nZAix5uKuEI+eUDeXscU=; b=OoNhtQqQ1AghhYvJgTMMkwD591 Q6Bjq7ZmY5Q0z+yjOJgitB4MpseuHRoNfB7xx0tHU7v/gFJS47+8GU6xFRGLiXOc qJnI0bs5W2TPYKD1Le0yabcLcZbZxMY8XD3Bjo1+ZSHhcGhdWGS8mx4WBThQpZoU 1Ueir5YnhiOxeFYZo5QCqkac7AIvumtvwRASx5EFD7oeA47AnHTWrUk9g/8ftREA NSF62qzfpL5CSIkk9wUPQppzbzTK03jIe1Ytx9ydOBuYv0sybl+ASYXD92dVDqVV 3KdelPTj8IP74x+VskZ8Jg+anxCdIqw/WXD2iWQNC8mFx5YO8XbG4fp5hjtw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1778843154; x=1778929554; bh=h6saPr12ttFQFxvyAJRTAG2nZAix5uKuEI+ eUDeXscU=; b=SCrmscO0qJx7u2DVv4rhFbAl+ofQ+IFU4+zMYKXHTOAvtEHdb+k /kSVTcDzuYeiNXVEUKJ2U3xv8fJfSppC2zWIlwF6uycMM+TPoGxiECFUPQm2qQoe ZfosquoDeckXGK09sf+7sHmRyp6pJ5LUSwWA+kCn+G7Yy/2xomOUoHJE2mmn0Dk5 T3aqNM8QBRcVvmPoc8GT2ZqWozWHFQJbT9Uf5XFYK+zd6CZETRa/39lAo6VcHjgX IIPhSvL4D45Fqu3KJJcDxXR7QZUDqR8IbjF0tG55vNvtsDwPqWxuk68JfzAcuY/y epQ6aqbUsvmRbkvgcZgdR0VRAAMnMEyOiAA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefhedrtddtgddufedtvdefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvffukfhfgggtuggjfgesthdtredttderjeenucfhrhhomheplfgrnhcurfgr lhhushcuoehjphgrlhhushesfhgrshhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrh hnpefgleelgffhvdfgffeiteetlefhuedvhffgtedtudevtdefuedtueekheeuvdehjeen ucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehjphgrlh hushesfhgrshhtmhgrihhlrdgtohhmpdhnsggprhgtphhtthhopeefpdhmohguvgepshhm thhpohhuthdprhgtphhtthhopegurghvihgusehgihgsshhonhdrughrohhpsggvrghrrd hiugdrrghupdhrtghpthhtohepphgrshhsthdquggvvhesphgrshhsthdrthhophdprhgt phhtthhopehssghrihhvihhosehrvgguhhgrthdrtghomh X-ME-Proxy: Feedback-ID: i01894241:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 15 May 2026 07:05:53 -0400 (EDT) Date: Fri, 15 May 2026 13:05:50 +0200 From: Jan Palus To: David Gibson , passt-dev@passt.top, Stefano Brivio Subject: Re: [PATCH 2/3] Fix build with -DNDEBUG Message-ID: References: <20260515041312.317644-1-david@gibson.dropbear.id.au> <20260515041312.317644-3-david@gibson.dropbear.id.au> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260515041312.317644-3-david@gibson.dropbear.id.au> User-Agent: NeoMutt/20260504 X-MailFrom: jpalus@fastmail.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation Message-ID-Hash: SD7INWWBD5JBX5SOPYX2YCMRR4NT2LJG X-Message-ID-Hash: SD7INWWBD5JBX5SOPYX2YCMRR4NT2LJG X-Mailman-Approved-At: Sat, 16 May 2026 11:57:28 +0200 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 15.05.2026 14:13, David Gibson wrote: > Since bc872d91765d, our assert() statements are omitted if we compile with > -DNDEBUG, like the standard library assert(3). Unfortunately a trivial but > embarrassing mistake in that patch means that instead of never aborting in > this case, assert_with_msg() *always* aborts, breaking pretty much > everything. > > There's also a missing #include that breaks the build with -DNDEBUG on at > least some library versions. > > Reported-by: Jan Palus > Fixes: bc872d91765d ("treewide: Spell ASSERT() as assert()") > Signed-off-by: David Gibson > --- > util.h | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/util.h b/util.h > index 70aadeba..11f71d45 100644 > --- a/util.h > +++ b/util.h > @@ -6,6 +6,7 @@ > #ifndef UTIL_H > #define UTIL_H > > +#include > #include > #include > #include > @@ -60,7 +61,7 @@ void abort_with_msg(const char *fmt, ...) > __func__, __FILE__, __LINE__, STRINGIFY(expr)) > #else > #define assert_with_msg(expr, ...) \ > - ((void)(expr), 0 ? (void)0 : abort_with_msg(__VA_ARGS__)) > + ((void)(expr), 1 ? (void)0 : abort_with_msg(__VA_ARGS__)) There is a slight semantic difference between assert() and assert_with_msg() when building with -DNDEBUG -- `expr` is still being evaluated in abort_with_msg() although likely optimized out in most builds. I'm assuming you'd prefer to avoid cppcheck suppressions. How about moving `expr` into branch which is never evaluated then? Would it keep cppcheck happy? + (1 ? (void)0 : ((void)(expr), abort_with_msg(__VA_ARGS__))) > #endif > > #ifdef P_tmpdir > -- > 2.54.0 >