From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: passt.top; dmarc=none (p=none dis=none) header.from=gibson.dropbear.id.au Authentication-Results: passt.top; dkim=pass (2048-bit key; secure) header.d=gibson.dropbear.id.au header.i=@gibson.dropbear.id.au header.a=rsa-sha256 header.s=202602 header.b=AYijB40r; dkim-atps=neutral Received: from mail.ozlabs.org (mail.ozlabs.org [IPv6:2404:9400:2221:ea00::3]) by passt.top (Postfix) with ESMTPS id 0ED9A5A0262 for ; Mon, 18 May 2026 04:14:41 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gibson.dropbear.id.au; s=202602; t=1779070477; bh=A0snc5CrjdUeuHBT3R27ZCvzw9bK9Ka2ZYrx6M46PuA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AYijB40rOXXhOwYqssGWBTLvYw9RqXgZhWhHbZWNpg96B/C1uwuWpN5DRSVxBE3IE qkCu9619bnuZEv03C4Z7UjoaepNW/cCMBZsVBzJTX3mLVNHXDoWZ0ER+uB77mYFfEE gaZfshBCzPkldvoM9nr4irIJd9t7I1+/2oJ77YuovDElR5fwiPPSLYLT8E2DEZ7at/ ml22Kw/WKLEk7Azf9tqDfCDq8M0CM8wIW7LkXkimTUFyB3f6dpElQISDe1jTFk9951 vovdvfZ1XMoVzSgiWYveoi3IwRamtQuifdjjE9bZX8IOpFJaMPxM5HK8pQJtzxaJk4 oqUMnN+LULaLQ== Received: by gandalf.ozlabs.org (Postfix, from userid 1007) id 4gJhFn0dvvz4wCJ; Mon, 18 May 2026 12:14:37 +1000 (AEST) Date: Mon, 18 May 2026 11:57:34 +1000 From: David Gibson To: Stefano Brivio Subject: Re: [PATCH] util: Fix changes to assert_with_msg() Message-ID: References: <20260517010740.138400-1-david@gibson.dropbear.id.au> <20260517144916.0bf00ebc@elisabeth> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Bl8SWifoa3v/zuff" Content-Disposition: inline In-Reply-To: <20260517144916.0bf00ebc@elisabeth> Message-ID-Hash: WGW7O7IC6JD6OEBGWMNV6LSD76JALX4Q X-Message-ID-Hash: WGW7O7IC6JD6OEBGWMNV6LSD76JALX4Q 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: passt-dev@passt.top, Jan Palus 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: --Bl8SWifoa3v/zuff Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Sun, May 17, 2026 at 02:49:17PM +0200, Stefano Brivio wrote: > [Cc: Jan with full quote] >=20 > On Sun, 17 May 2026 11:07:40 +1000 > David Gibson wrote: >=20 > > A last minute fixup to commit e51494552b78 was misapplied. Instead of > > improving the implementation of assert_with_msg() for the case where > > NDEBUG is defined, it effectively eliminated assert_with_msg() in the > > normal case where NDEBUG is _not_ defined. As well as removing assert(= )s > > which protect us in case of certian types of bug, this introduces some > > cppcheck and clang-tidy regressions. > >=20 > > Fixes: e51494552b78 ("Fix build with -DNDEBUG") > > Signed-off-by: David Gibson >=20 > Oops, sorry, I think I misread the "#ifndef NDEBUG" and read it as > "#ifdef NDEBUG". :( Heh, yeah. I'm pretty sure I almost-but-not-quite did that a half dozen times writing the series. >=20 > Applied, thanks for spotting this. >=20 > > --- > > util.h | 4 ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > >=20 > > diff --git a/util.h b/util.h > > index a9dcc04c..144dc1e6 100644 > > --- a/util.h > > +++ b/util.h > > @@ -51,7 +51,7 @@ void abort_with_msg(const char *fmt, ...) > > */ > > #ifndef NDEBUG > > #define assert_with_msg(expr, ...) \ > > - (1 ? (void)0 : ((void)(expr), abort_with_msg(__VA_ARGS__))) > > + ((expr) ? (void)0 : abort_with_msg(__VA_ARGS__)) > > /* The standard library assert() hits our seccomp filter and dies befo= re it can > > * actually print a message. So, replace it with our own version. > > */ > > @@ -61,7 +61,7 @@ void abort_with_msg(const char *fmt, ...) > > __func__, __FILE__, __LINE__, STRINGIFY(expr)) > > #else > > #define assert_with_msg(expr, ...) \ > > - ((void)(expr), 1 ? (void)0 : abort_with_msg(__VA_ARGS__)) > > + (1 ? (void)0 : ((void)(expr), abort_with_msg(__VA_ARGS__))) > > #endif > > =20 > > #ifdef P_tmpdir >=20 > --=20 > Stefano >=20 --=20 David Gibson (he or they) | I'll have my music baroque, and my code david AT gibson.dropbear.id.au | minimalist, thank you, not the other way | around. http://www.ozlabs.org/~dgibson --Bl8SWifoa3v/zuff Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEO+dNsU4E3yXUXRK2zQJF27ox2GcFAmoKcggACgkQzQJF27ox 2GcKfxAAnrf7/xss/G4TiVdHlZ+Kfn1WL9MH3NAXnDu2GU/auiUB0AqYWIDvpkqI ipp9mPQ2A5pZlAThdZtzDRgFo0Bt9AbfbfOQsI4ZIj0b+c560Lu+z16OEp9owrcx w1nLSXae9nlWLaHZYI606cC2r8cLl+vtHTMZ90MfTMSn6s6VgkQpGzGPVp6BdI/P 8+NgfUVEt7tp5YcIW5Ikn36YGTc0qZWBLT492w3EcvDnGfp2hu011TcMLEheMkiq soeZDFMlV1R8IZLZt0zCdG4vdpnMKxC0l2y8fwglynLaSONZ0c/DBdnvzhye25ZE wUQBaLxm4pewN9ceYidQ97LDlpEyi1EVh1etG2FzNpOQI+PpB+EDHRJ6GllQWV4r DHuJPo3lSWfI0wDSmA05JBAIYBpgEiAOQHmAACZhIlSrv4XUo4USmSu5XqkcNTD6 zSjlmbNWLJ+4CwzODX+xCR1PWLZS5mLEDoI+yE9lrlLwGnvSJThrH9UguwzFpsOd 1kImtkGe0uhj6CmYFV0VpJ7jq3RnhE1H0/emIq9OEAor4mLnz+AZzxPdRXPXdLV4 gF43rjd58yPuKOpys2Iq5b51wcHtrfhWR+UOtj5SCIGH/ok5ojdUWdlSHsjBI5F2 SwmWp4nWdTk4urZBQ4fFsS1abDOiNDofnCErr2B4aNB7lNY+9+I= =j/o5 -----END PGP SIGNATURE----- --Bl8SWifoa3v/zuff--