From nobody Sat Feb 21 17:53:14 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 4fJF8t2Mffz6Sytt for ; Sat, 21 Feb 2026 17:53:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fJF8t1dLHz42y7 for ; Sat, 21 Feb 2026 17:53:34 +0000 (UTC) (envelope-from yaneurabeya@gmail.com) Authentication-Results: mx1.freebsd.org; none Received: by mail-pf1-x443.google.com with SMTP id d2e1a72fcca58-824a3509a12so1696803b3a.2 for ; Sat, 21 Feb 2026 09:53:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771696406; x=1772301206; darn=freebsd.org; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:from:to:cc:subject:date:message-id:reply-to; bh=dcalczmICKkjVg9aKXXqz8X5bbnsxdtacOPYkw6BO7A=; b=Ul3Hg/EgO7Dszadgfv98qedaFxqhCF5Yjya+mz8gYWKTSDc8Un6DOuYr7ud4rt7SmS hehdq2eHV7AZFgnYJVXNcJ35r6SNWO+kEpGs/pesM+0I0oJ8EDsvp+3DFfk45NxkliJl R/chLAP7FvSRHZCJcyB7QiY6Wi8GBwSiinZWljkXHfpziZXRgjmKbzQEqASuFI2mwgkV 1ZVRS7HeceBzukSnDaZZ/9MrHXA6YT3GIZhm/jbriD8M99FPjRDXxG1aXTqWZIMTjfCw WuG/JYKx5FaeCbjPLIA5ZU0FHcSqGlQxxGEaIiUVqkjZIJmK8yhe2XSeTTiHL4PtFuIj Cb9Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771696406; x=1772301206; h=references:to:cc:in-reply-to:date:subject:mime-version:message-id :from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=dcalczmICKkjVg9aKXXqz8X5bbnsxdtacOPYkw6BO7A=; b=rV7qXLl60Jpds8Rr/A2i9XuJYSjms9a7U5tYjXVLAKthdQLP2Jit++ka3NfQPUplEM wZLdiNxgRqQro4i9hfU8CsH/mI6gSVF+sZfGVd2diX4kbkan/lS1rqvZKT2gSAwsQGWD 8yWIk2rLc8S9QF+B7Q0XJWLo29LihiFS1SEWm6CZnUK/Qos2dL9yaSLtNODD1Ow2lQlD Ff/iUZGHiwCRa6jyc5MFwNzjdZypV0xOV9gF9jqC51qC/yjuHyqYX55m+k3r5MZFkOx8 iwER9XCrzj0pUTyv/HPCjqEaqRpDAnIsEzF0Fb99N2xcRTD5nvARZ/660N7ix86iIUFr m+Ag== X-Forwarded-Encrypted: i=1; AJvYcCVyw1odXVI1WysvMwfExr+bcpKq2IASeoabh0OJ124vTtXJhOK09N3myRGYzyXQoxEBeLY8w8rVoIArMbHanJw01eT6Bw==@freebsd.org X-Gm-Message-State: AOJu0YzwPQUlPlmpMX5xNqvvPq/rVuRnI918q7xeoTrUzxz97e3aOlc4 UipxSkbCDuFEL/n4w17VZMG9BTQX6QIrto7VXxdVz/y3Srp15UF0FXR1 X-Gm-Gg: AZuq6aJNrs5fZQsaq6nC+rx+dnIRjQHn/jFZVp/31wEquuv4SVZbmXjVO500edZh1B2 uh6lTomFBEc6peBhMianErhJuHL7sLUSROCCDGjJyTAA2gjcBvdFnHAN7eJOm8h+fp68QXBZyDA SeNpvhQ2X5lCBacpNVVjZJnV7YM/4UmF7pVaOcX+78yrDMzPM83zQVO/XMieJgm+JDP5EIe1S+y hfqY1DK4BmiqvGwOjvpUS//itPkfyg2eNHOJXqvZCVYMTMShLYY5BjZHViUlmvx8qHokqdD72Uc TGLHuJuGuxoayxWrBL7m1eq2MuxqPjjp1/nZhlbDnmjRIKF5r5LugiUdIFq7xQVSPHayipB5hFS 4eHbx28AFrhvBqECiYMgisLNFZTbS5hQ+RfD9vJM3aUyAMG8U1r2QAObDYoYdTIMdOFHlXJck4w spKVc7QooRLauO1QigpWA1uKQMXYyVLRI9wzG8qfyshQ== X-Received: by 2002:a05:6a00:4186:b0:823:1475:85a4 with SMTP id d2e1a72fcca58-826da9037afmr2552029b3a.24.1771696406049; Sat, 21 Feb 2026 09:53:26 -0800 (PST) Received: from smtpclient.apple ([176.100.43.124]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-826dd64111csm2509384b3a.6.2026.02.21.09.53.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 21 Feb 2026 09:53:25 -0800 (PST) From: "Enji Cooper (yaneurabeya)" Message-Id: <2D23AD65-FC83-486F-99BD-1C2DAF6BCE05@gmail.com> Content-Type: multipart/alternative; boundary="Apple-Mail=_6B555CD4-2C50-408A-93D8-A69C3F5BF75D" 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 (Mac OS X Mail 16.0 \(3826.700.81.1.4\)) Subject: Re: git: d1f1402dff63 - main - libnetbsd: import `__CTASSERT(..)` macros Date: Sat, 21 Feb 2026 09:53:14 -0800 In-Reply-To: Cc: Enji Cooper , "src-committers@freebsd.org" , "dev-commits-src-all@freebsd.org" , "dev-commits-src-main@freebsd.org" To: John Baldwin References: <6998e4cc.32d8e.74c069d@gitrepo.freebsd.org> X-Mailer: Apple Mail (2.3826.700.81.1.4) X-Rspamd-Pre-Result: action=no action; module=replies; Message is reply to one we originated X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2607:f8b0::/32, country:US] X-Rspamd-Queue-Id: 4fJF8t1dLHz42y7 X-Spamd-Bar: ---- --Apple-Mail=_6B555CD4-2C50-408A-93D8-A69C3F5BF75D Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On Feb 21, 2026, at 8:04=E2=80=AFAM, John Baldwin = wrote: >=20 > On 2/20/26 17:48, Enji Cooper wrote: >> The branch main has been updated by ngie: >> URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd1f1402dff63dd163d4ba4ac65f7f2ff= d00c5e08 >> commit d1f1402dff63dd163d4ba4ac65f7f2ffd00c5e08 >> Author: Enji Cooper >> AuthorDate: 2026-02-20 20:24:46 +0000 >> Commit: Enji Cooper >> CommitDate: 2026-02-20 22:45:06 +0000 >> libnetbsd: import `__CTASSERT(..)` macros >> These compile-time assert macros are similar to = `Static_assert` on FreeBSD. >> These macros are in use in newer versions of = `contrib/netbsd-tests`. >=20 > FYI, _Static_assert is not a FreeBSD-ism, it's part of C11. Our old = CTASSERT is > a FreeBSD-ism that this extends, but really, these should be = implemented in > terms of _Static_assert when possible. Something like: >=20 > #if is_c11 > #define __CTASSERT(x) __Static_assert(x) > #else > /* all the rest */ > #endif >=20 > If __CTASSERT0 is used directly anywhere, you could emulate it via = something like >=20 > #define __CTASSERT0(x, y, z) __Static_assert(x, __STRING(y) "_" = __STRING(z)) >=20 > (Note that we build all of userspace as C17 by default in 15.0 and = later.) Hi jhb@! Excellent points. Incorporating our macros/adaptations can cause grief = sometimes and I don=E2=80=99t 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]). -Enji 1. = https://github.com/NetBSD/src/blob/c26cc77b3a0b26b95a2df2e0154e2b2f7292ab2= 0/sys/sys/cdefs.h#L168-L182= --Apple-Mail=_6B555CD4-2C50-408A-93D8-A69C3F5BF75D Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8
On Feb 21, = 2026, at 8:04=E2=80=AFAM, John Baldwin <jhb@freebsd.org> = wrote:

On 2/20/26 = 17:48, Enji Cooper wrote:
The branch main = has been updated by ngie:
URL: = https://cgit.FreeBSD.org/src/commit/?id=3Dd1f1402dff63dd163d4ba4ac65f7f2ff= d00c5e08
commit d1f1402dff63dd163d4ba4ac65f7f2ffd00c5e08
Author: =     Enji Cooper = <ngie@FreeBSD.org>
AuthorDate: 2026-02-20 20:24:46 = +0000
Commit:     Enji Cooper = <ngie@FreeBSD.org>
CommitDate: 2026-02-20 22:45:06 +0000
=     libnetbsd: import `__CTASSERT(..)` macros
=          These compile-time = assert macros are similar to `Static_assert` on FreeBSD.
=          These macros are = in use in newer versions of = `contrib/netbsd-tests`.

FYI, _Static_assert is not a = FreeBSD-ism, it's part of C11.  Our old CTASSERT is
a = FreeBSD-ism that this extends, but really, these should be implemented = in
terms of _Static_assert when possible.  Something = like:

#if is_c11
#define __CTASSERT(x) =  __Static_assert(x)
#else
/* all the rest = */
#endif

If __CTASSERT0 is used directly anywhere, you could = emulate it via something like

#define __CTASSERT0(x, y, z) =  __Static_assert(x, __STRING(y) "_" __STRING(z))

(Note that = we build all of userspace as C17 by default in 15.0 and = later.)

Hi = jhb@!

Excellent points. Incorporating our macros/adaptations can cause grief = sometimes and I don=E2=80=99t 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]).

-Enji

= = --Apple-Mail=_6B555CD4-2C50-408A-93D8-A69C3F5BF75D--