+2022-09-21 Paul Eggert <eggert@cs.ucla.edu>
+
+ assert-h: suppress clang false alarms
+ Suppress scads of annoying warnings from clang version 14.0.5
+ (Fedora 14.0.5-1.fc36) of the form "warning: '_Static_assert' with
+ no message is a C2x extension [-Wc2x-extensions]",
+ by refusing to use single-arg static_assert with older clang.
+ * m4/assert_h.m4 (gl_ASSERT_H): Turn -Wc2x-extensions from a
+ warning into an error when testing static_assert, so that the
+ annoying diagnostic causes the test to fail, which causes assert.h
+ to be replaced in a way that suppresses the diagnostic during
+ the real build.
+
2022-09-20 Bruno Haible <bruno@clisp.org>
Add another helper script for creating testdirs.
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM(
- [[#ifdef INCLUDE_ASSERT_H
+ [[#if defined __clang__ && __STDC_VERSION__ < 202311
+ #pragma clang diagnostic error "-Wc2x-extensions"
+ #endif
+ #ifdef INCLUDE_ASSERT_H
#include <assert.h>
#endif
static_assert (2 + 2 == 4, "arithmetic does not work");