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=dnN9kOk9; dkim-atps=neutral Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTPS id EA7955A0269 for ; Tue, 17 Mar 2026 01:02:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1773705758; 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=SIfwEt3AKJjO45jSV1bcbX+yyQZMANqjE34csioUMus=; b=dnN9kOk9eZgC3OpkWhyOGoTXPyVd70TlA23iv8Z9/TV8zbEtdf2u8qanQiUrla+DX8QEkf 10iJhq2E120xfkSE99S5KiyjSzyLs6lF9CVKBNDDR+ZbQcqHFElWDlqCEYCMYt3OyTmFeT WakhDTI7THHUgPTaeB20irWEXy0w9rk= 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-108-D3kZOxJXO2GvhGR3029C6A-1; Mon, 16 Mar 2026 20:02:37 -0400 X-MC-Unique: D3kZOxJXO2GvhGR3029C6A-1 X-Mimecast-MFC-AGG-ID: D3kZOxJXO2GvhGR3029C6A_1773705756 Received: by mail-wm1-f72.google.com with SMTP id 5b1f17b1804b1-4837bfcfe0dso70011895e9.1 for ; Mon, 16 Mar 2026 17:02:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773705756; x=1774310556; 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=SIfwEt3AKJjO45jSV1bcbX+yyQZMANqjE34csioUMus=; b=avv6WZYF7HswMObk+KEPtpOjhj1xKtS8uMlyjWJ4GGH8zPnvaGVLc7VD9haxb8QJh3 P3/8zH/lJwKolRiPWnNb1Kdrn5v3h/TIiTdyp/J0ka9+hXF306tYggj3UvfS9jgJUPbf ZT8VDem3fWu6J5fu26Rxt/DGmAmrIUIq4GYg7zYQv41ahCFNNnymnB/WmIuPGtadK1j5 HgfnnTmS8Ft7I5LXA29zExuXM7GZZtUa+5QFK2pWyR7FGF40EnY1cK3mizd10jmsvH/5 XGSkciEjjZGFymVfUDIRgabBzCtmEi/nkKRV6irR287JMauP+KnDzD50qxOjfVxCdH5r p+hw== X-Gm-Message-State: AOJu0Yxd30tEU6xs8YDN2nhu4V4ahez/ld21v+AeKg+GkF3ecV2SrEft yNJTQ52FLR4t+LUk/S0g5kdBmSF+aCrJ22UUKrziVAt9/z5O+0D1UqekkhieN1rJW15DrjJGK8n ifgDM2dxDtqXuAbTLL4y3lin6OZEDkhQXKZse9SZMwVtVn6vXED/gswvhsJvAxsla X-Gm-Gg: ATEYQzxsBSxXej2mQvNUHrBnFEsRcn086GvbCi7RRwBaOK/vtcrFe6719Rm4BKzh462 vyxZ0RFtsFDZn1XM/Smv0ieAyH/1QHh/NvvCSx3z7jZu/+5HT1sMepuRxJ+vDWfcOJ0gZppRuUA yVXFOHUin4tcth+Ych/IPG1A78F9+zQg0zO/NXLtLeVjljYvxH5YYesaF4uQcy0UyI0T1FROPTX 0wGXT2mLShS4zgmLf9EswmKCMx8ckTRgXYUwo9ket5bQOmiGgYlBhTf41IuBxvjFvK0Ml+m9C0O ARDfDB9lJx19UEpQJ8pNCVL2rPFCJyz3VYRE9aSnYH2VrVd9kbAIrbLPOsna1dVKY1jYiMln4fL b7EWNV+lxFBN3uMc605/Q8kXICdxd/8My X-Received: by 2002:a05:600c:3b14:b0:485:3aa1:a7f0 with SMTP id 5b1f17b1804b1-485566cfbadmr263017835e9.4.1773705755752; Mon, 16 Mar 2026 17:02:35 -0700 (PDT) X-Received: by 2002:a05:600c:3b14:b0:485:3aa1:a7f0 with SMTP id 5b1f17b1804b1-485566cfbadmr263017385e9.4.1773705755251; Mon, 16 Mar 2026 17:02:35 -0700 (PDT) Received: from maya.myfinge.rs (ifcgrfdd.trafficplex.cloud. [2a10:fc81:a806:d6a9::1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4856eae3037sm26011825e9.11.2026.03.16.17.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Mar 2026 17:02:34 -0700 (PDT) From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 4/5] treewide: Spell ASSERT() as assert() Message-ID: <20260317010233.0723ea6d@elisabeth> In-Reply-To: <20260316054629.239002-5-david@gibson.dropbear.id.au> References: <20260316054629.239002-1-david@gibson.dropbear.id.au> <20260316054629.239002-5-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, 17 Mar 2026 01:02:34 +0100 (CET) X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: 2s4oaOmRKqzBUkOOJX93BGf74am18etVFC23u6MD2sY_1773705756 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: 3RH5ECL2PUZOW6JLCSWQ7USODCFTVYI5 X-Message-ID-Hash: 3RH5ECL2PUZOW6JLCSWQ7USODCFTVYI5 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: 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 Mon, 16 Mar 2026 16:46:28 +1100 David Gibson wrote: > +++ b/util.h > @@ -73,10 +73,14 @@ void abort_with_msg(const char *fmt, ...) > * Therefore, avoid using the usual do while wrapper we use to force the macro > * to act like a single statement requiring a ';'. > */ > -#define ASSERT_WITH_MSG(expr, ...) \ > +#define assert_with_msg(expr, ...) \ > ((expr) ? (void)0 : abort_with_msg(__VA_ARGS__)) > -#define ASSERT(expr) \ > - ASSERT_WITH_MSG((expr), "ASSERTION FAILED in %s (%s:%d): %s", \ > +/* The standard library assert() hits our seccomp filter and dies before it can > + * actually print a message. So, replace it with our own version. > + */ > +#undef assert > +#define assert(expr) \ > + assert_with_msg((expr), "ASSERTION FAILED in %s (%s:%d): %s", \ > __func__, __FILE__, __LINE__, STRINGIFY(expr)) While looking this up to make sure it's specified as a macro (it is, and this builds against musl as well), I realised that POSIX.1-2024 says: https://pubs.opengroup.org/onlinepubs/9799919799/functions/assert.html Forcing a definition of the name NDEBUG, either from the compiler command line or with the preprocessor control statement #define NDEBUG ahead of the #include statement, shall stop assertions from being compiled into the program. ...so, I wonder, now that it's called assert(), should we define it as "do { } while(0)" #ifdef NDEBUG, for correctness (and maybe somebody has obscure usages for NDEBUG which we shouldn't sabotage)? This will conflict with "[PATCH v2 3/3] vu_common: Move iovec management into vu_collect()" by the way, but I'll take care of it, if it still conflicts by the time I merge it. -- Stefano