> On Nov 14, 2025, at 10:13, Thomas Munro <thomas.munro@gmail.com> wrote:
>
> Hi,
>
> I won't be surprised if Peter (CC'd) already has a patch for this in
> his C11 incubation branch, but if not, maybe this will be useful.
>
> While experimenting with threads and atomics on various systems, I
> didn't like the way our macros failed in the ancient fallback code on
> Visual Studio. That only seems to be necessary for
> StaticAssertExpr(), the rarest case. That led to some observations:
>
> * the meson script defines HAVE__STATIC_ASSERT if you have GCC
> statement expressions, so why not just say so with
> HAVE_STATEMENT_EXPRESSIONS, and keep ye olde fallback only for
> StaticAssertExpr()?
>
+1, I think this is clearer.
>
> . o O { I wonder if it's possible to write a C23/C++17-compatible
> single-argument static_assert() macro, or if you'd get stuck in a loop
> and need to use a different name... the message argument is so often
> boring/redundant... }
> <0001-Refactor-static_assert-support.patch>
A few small comments:
1
```
main ()
{
-({ _Static_assert(1, "foo"); })
+({ _Static_assert(1, "foo"); });
+
;
return 0;
}
```
As you added a semi-colon in the line, the one after the empty line can be deleted, though C allows empty statement,
butunnecessary, and may lead to confusion for code readers.
2
```
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__static_assert" >&5
-$as_echo "$pgac_cv__static_assert" >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $pgac_cv__statement_expressions" >&5
+$as_echo "$pgac_cv__statement_expressions" >&6; }
if test x"$pgac_cv__static_assert" = xyes ; then
```
You missed to replace this pgac_cv__static_assert with the new name.
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/