From nobody Tue Feb 24 17:54:55 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fL53633sxz6ShPh; Tue, 24 Feb 2026 17:54:58 +0000 (UTC) (envelope-from glebius@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fL5362bDWz3SPr; Tue, 24 Feb 2026 17:54:58 +0000 (UTC) (envelope-from glebius@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771955698; 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=9td9AehFmPQCnja9mVQhzqlIMy8dj4HSPzS0zg+LWxY=; b=nFjBN4Ul1GfAv7ZjkMSfTWSNHHhhFNVwTaIiNM/sRIVSTKMgJ7iDvlgao2tdKcJJQnzvFN 7HlOhf76LpqoFnHsjkUexqtsTXyqhkOuaK5RRpZJpdis6lUZZM/9I7Ym/rTIdAIVe9DfzK nM8cUJPJNWPGIIti8AFj1KOUHO8Q1Nt2JYI6lMil+cIyTAC2MGmQWD6u4V5VpJtT/LkUi4 WDKTfeik6SWf9OKylOSVphtm3SJFTt1Jrt1mxH6A+MzeTLfbOlYc6nHeVjm57hMnJ3wtaQ ga5Hev5eYb4D4oG6HGvoZ5y48BlucZrjmMGjmCVwCW2KTGUwjTR81+q+gR0Gqg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771955698; a=rsa-sha256; cv=none; b=UKU585/84wKePB9fw43qjpa4K7mT7+NOeaOwoCdzhvjvglxVvlN2Y2mkEAT04BwVn2LiR7 liy7Umrq+E2/py8n8WF2hXIfZfJQfwwhDdor7suGK0aflP2zicpNifIAzJpV7RHxy3I1Qa 9o87QAyEFG3KXtMQnfvlw7cG0XhWXiFLf8Zte9HdIaV5DkcIxHpHs3J/ls90OwCCdpzIl7 bQUNkScayans1LlsGuJhkfFpnwzPqnxDJt351R2hEXnIukoimRksQGW+oyx5MVII6iseGa JkAlJwpkLTZZyqH0kenZIu7DDgcJELDAshNg7wZ9fryuRC0Rs3ek/1ieoU+yCg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771955698; 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=9td9AehFmPQCnja9mVQhzqlIMy8dj4HSPzS0zg+LWxY=; b=MV+8pHfDGqw0F2R/hKfKUiY4zn5JMR93xo5+wCSRT++eb8qzRHaeb3P5P9cJnPw95Fh7zO T1GrNzE1uHWDPSxJngsng5lzN2Flx27VHt7kIZv4eD3dkzx7QVEp91o5tT7zP+x8v7MlBN UWU/KOsy70NHprHVYoWaEIImytrIM19sn5Skq6LhzF8Hs3wYGPj9oUbmencDZa/7DKyeoP awZ2hqwvUdpc9cVVQGX6J+HKUzrQHqXKdR7Svn7JYASc0uJfi393afDPlzVHkNFqSGHfiT ZbufM/+bPEUN47ZsNML+jElrBY/F7yOWpKzjLRX7/eSHUC1EzaRdq2jmdUx3GA== Received: from cell.glebi.us (glebi.us [162.251.186.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: glebius) by smtp.freebsd.org (Postfix) with ESMTPSA id 4fL5354M98ztrM; Tue, 24 Feb 2026 17:54:57 +0000 (UTC) (envelope-from glebius@freebsd.org) Date: Tue, 24 Feb 2026 09:54:55 -0800 From: Gleb Smirnoff To: "Enji Cooper (yaneurabeya)" Cc: John Baldwin , Enji Cooper , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" Subject: Re: git: d1f1402dff63 - main - libnetbsd: import `__CTASSERT(..)` macros Message-ID: References: <6998e4cc.32d8e.74c069d@gitrepo.freebsd.org> <2D23AD65-FC83-486F-99BD-1C2DAF6BCE05@gmail.com> List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2D23AD65-FC83-486F-99BD-1C2DAF6BCE05@gmail.com> On Sat, Feb 21, 2026 at 09:53:14AM -0800, Enji Cooper (yaneurabeya) wrote: E> > FYI, _Static_assert is not a FreeBSD-ism, it's part of C11. Our old CTASSERT is E> > a FreeBSD-ism that this extends, but really, these should be implemented in E> > terms of _Static_assert when possible. Something like: E> > E> > #if is_c11 E> > #define __CTASSERT(x) __Static_assert(x) E> > #else E> > /* all the rest */ E> > #endif E> > E> > If __CTASSERT0 is used directly anywhere, you could emulate it via something like E> > E> > #define __CTASSERT0(x, y, z) __Static_assert(x, __STRING(y) "_" __STRING(z)) E> > E> > (Note that we build all of userspace as C17 by default in 15.0 and later.) E> E> E> Hi jhb@! E> E> Excellent points. Incorporating our macros/adaptations can cause grief sometimes and I don’t want to porting more code than necessary, so I have incorporated these macros (and a few others) wholesale from NetBSD (I got these from [1]). E> E> -Enji E> E> 1. https://github.com/NetBSD/src/blob/c26cc77b3a0b26b95a2df2e0154e2b2f7292ab20/sys/sys/cdefs.h#L168-L182 I don't expect any grief if __CTASSERT() is implemented via __Static_assert(). -- Gleb Smirnoff