Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 30 May 2026 13:44:26 +0000
From:      Robert Clausecker <fuz@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Cc:        Faraz Vahedi <kfv@kfv.io>
Subject:   git: c5c7d18d0118 - main - libc: Restrict the static_assert macro to pre-C23 modes
Message-ID:  <6a1ae9ba.30b38.52069bbf@gitrepo.freebsd.org>

index | next in thread | raw e-mail

The branch main has been updated by fuz:

URL: https://cgit.FreeBSD.org/src/commit/?id=c5c7d18d011830088a2134e1be32f610f1f3e797

commit c5c7d18d011830088a2134e1be32f610f1f3e797
Author:     Faraz Vahedi <kfv@kfv.io>
AuthorDate: 2026-05-17 20:47:49 +0000
Commit:     Robert Clausecker <fuz@FreeBSD.org>
CommitDate: 2026-05-30 13:43:51 +0000

    libc: Restrict the static_assert macro to pre-C23 modes
    
    Signed-off-by:  Faraz Vahedi <kfv@kfv.io>
    Reviewed by:    fuz
    MFC after:      1 month
    Pull Request:   https://github.com/freebsd/freebsd-src/pull/2203
---
 include/assert.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/include/assert.h b/include/assert.h
index a3dbe933e18f..a089d7b79915 100644
--- a/include/assert.h
+++ b/include/assert.h
@@ -72,8 +72,11 @@
  * C++ template parameters may contain commas, even if not enclosed in
  * parentheses, causing the _Static_assert macro to be invoked with more
  * than two parameters.
+ *
+ * C23 defines static_assert and its obsolescent alternative spelling,
+ * _Static_assert, as keywords.
  */
-#if __ISO_C_VISIBLE >= 2011 && !defined(__cplusplus)
+#if __ISO_C_VISIBLE >= 2011 && __ISO_C_VISIBLE < 2023 && !defined(__cplusplus)
 #define	static_assert	_Static_assert
 #endif
 


home | help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?6a1ae9ba.30b38.52069bbf>