bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
* [PROPOSED 0/2] static_assert and C23
@ 2022-09-13  3:32 Paul Eggert
  2022-09-13  3:32 ` [PROPOSED 1/2] assert-h: static_assert is a keyword in C23 Paul Eggert
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Paul Eggert @ 2022-09-13  3:32 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

In the spirit of the recent patches for bool and C23, here's a
proposed pair of patches for C23's new keyword static_assert.
This uses a similar approach, in that the existing assert-h module,
which already provides an <assert.h> that supplies a static_assert macro,
is modified to provide something like C23 static_assert even if you
don't include <assert.h>.  This patchset does differ from the bool
patchset in that we can't assume the system <assert.h> supplies a
static_assert macro since Gnulib doesn't assume C11.

I haven't installed these into Gnulib.  Comments welcome.

Paul Eggert (2):
  assert-h: static_assert is a keyword in C23
  assert-h: prefer to ‘verify’

 ChangeLog                           |  65 +++++++
 doc/gnulib.texi                     |  27 ++-
 doc/posix-headers/assert.texi       |  38 ++--
 lib/alignalloc.c                    |   5 +-
 lib/argmatch.h                      |   4 +-
 lib/c32is-impl.h                    |   3 +-
 lib/c32snrtombs.c                   |   4 +-
 lib/c32srtombs.c                    |   4 +-
 lib/exclude.c                       |   9 +-
 lib/filevercmp.c                    |   3 +-
 lib/fma.c                           |   5 +-
 lib/i-ring.h                        |   3 +-
 lib/ino-map.c                       |   3 +-
 lib/localeinfo.c                    |   8 +-
 lib/malloca.c                       |   3 +-
 lib/mbrtoc32.c                      |   3 +-
 lib/mbrtowc.c                       |   3 +-
 lib/mbsinit.c                       |   3 +-
 lib/mbsnrtoc32s.c                   |   4 +-
 lib/mbsrtoc32s.c                    |   4 +-
 lib/nanosleep.c                     |   3 +-
 lib/parse-datetime.y                |   9 +-
 lib/pipe2.c                         |   3 +-
 lib/rawmemchr.c                     |   3 +-
 lib/relocwrapper.c                  |   3 +-
 lib/sleep.c                         |   4 +-
 lib/stat-w32.c                      |   3 +-
 lib/stat.c                          |   1 -
 lib/strerror.c                      |   3 +-
 lib/strtoimax.c                     |   6 +-
 lib/utimecmp.c                      |   3 +-
 lib/vasnprintf.c                    |  11 +-
 m4/assert_h.m4                      |  43 ++++-
 modules/alignalloc                  |   2 +-
 modules/alignof-tests               |   3 +-
 modules/argmatch                    |   2 +-
 modules/assert-h                    |   2 +-
 modules/assert-h-tests              |   3 +
 modules/c-vasnprintf                |   2 +-
 modules/c32isalnum                  |   2 +-
 modules/c32isalpha                  |   2 +-
 modules/c32isblank                  |   2 +-
 modules/c32iscntrl                  |   2 +-
 modules/c32isdigit                  |   2 +-
 modules/c32isgraph                  |   2 +-
 modules/c32islower                  |   2 +-
 modules/c32isprint                  |   2 +-
 modules/c32ispunct                  |   2 +-
 modules/c32isspace                  |   2 +-
 modules/c32isupper                  |   2 +-
 modules/c32isxdigit                 |   2 +-
 modules/c32snrtombs                 |   2 +-
 modules/c32srtombs                  |   2 +-
 modules/exclude                     |   2 +-
 modules/filevercmp                  |   2 +-
 modules/fma                         |   2 +-
 modules/fmaf                        |   2 +-
 modules/fmal                        |   2 +-
 modules/fstat                       |   2 +-
 modules/i-ring                      |   2 +-
 modules/ino-map                     |   2 +-
 modules/intprops-tests              |   2 +-
 modules/libgmp-tests                |   2 +-
 modules/limits-h-tests              |   2 +-
 modules/locale-tests                |   2 +-
 modules/malloca                     |   2 +-
 modules/mbrtoc32                    |   2 +-
 modules/mbrtowc                     |   2 +-
 modules/mbsinit                     |   2 +-
 modules/mbsnrtoc32s                 |   2 +-
 modules/mbsrtoc32s                  |   2 +-
 modules/nanosleep                   |   2 +-
 modules/parse-datetime              |   2 +-
 modules/pipe2                       |   2 +-
 modules/pthread-h-tests             |   2 +-
 modules/rawmemchr                   |   2 +-
 modules/relocatable-prog-wrapper    |   2 +-
 modules/round-tests                 |   2 +-
 modules/roundf-tests                |   2 +-
 modules/sleep                       |   2 +-
 modules/stat                        |   2 +-
 modules/stdalign-tests              |   2 +-
 modules/stdckdint-tests             |   2 +-
 modules/stddef-tests                |   2 +-
 modules/stdio-tests                 |   2 +-
 modules/stdlib-tests                |   2 +-
 modules/strerror                    |   2 +-
 modules/string-tests                |   2 +-
 modules/strtoimax                   |   2 +-
 modules/strtoumax                   |   2 +-
 modules/sys_stat-tests              |   2 +-
 modules/time-tests                  |   2 +-
 modules/uchar-tests                 |   2 +-
 modules/unistd-tests                |   2 +-
 modules/unistdio/u16-u16-vasnprintf |   2 +-
 modules/unistdio/u16-vasnprintf     |   2 +-
 modules/unistdio/u32-u32-vasnprintf |   2 +-
 modules/unistdio/u32-vasnprintf     |   2 +-
 modules/unistdio/u8-u8-vasnprintf   |   2 +-
 modules/unistdio/u8-vasnprintf      |   2 +-
 modules/unistdio/ulc-vasnprintf     |   2 +-
 modules/utimecmp                    |   2 +-
 modules/vasnprintf                  |   2 +-
 modules/wchar-tests                 |   2 +-
 tests/test-alignof.c                |   4 +-
 tests/test-assert.c                 |  71 +++++++
 tests/test-intprops.c               |   3 +-
 tests/test-libgmp.c                 |   4 +-
 tests/test-limits-h.c               |  50 +++--
 tests/test-locale.c                 |   4 +-
 tests/test-pthread.c                |   2 -
 tests/test-round2.c                 |   4 +-
 tests/test-stdalign.c               |  10 +-
 tests/test-stddef.c                 |  43 +++--
 tests/test-stdio.c                  |   4 +-
 tests/test-stdlib.c                 |   4 +-
 tests/test-string.c                 |   4 +-
 tests/test-sys_stat.c               | 276 ++++++++++++++--------------
 tests/test-time.c                   |   6 +-
 tests/test-uchar.c                  |  12 +-
 tests/test-unistd.c                 |   4 +-
 tests/test-wchar.c                  |   4 +-
 122 files changed, 540 insertions(+), 409 deletions(-)
 create mode 100644 tests/test-assert.c

--
2.37.2



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [PROPOSED 1/2] assert-h: static_assert is a keyword in C23
  2022-09-13  3:32 [PROPOSED 0/2] static_assert and C23 Paul Eggert
@ 2022-09-13  3:32 ` Paul Eggert
  2022-09-13  3:32 ` [PROPOSED 2/2] assert-h: prefer to ‘verify’ Paul Eggert
  2022-09-13 22:50 ` [PROPOSED 0/2] static_assert and C23 Bruno Haible
  2 siblings, 0 replies; 13+ messages in thread
From: Paul Eggert @ 2022-09-13  3:32 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
If not, arrange for config.h to #define static_assert
by including <assert.h>, and then do "#undef assert"
so that the assert macro still needs an explicit include.
This should be safe even on very old hosts, as assert.h
has been re-includable for decades.
* tests/tests-assert.c: New test.
* modules/assert-h-tests (Files, Makefile.am): Add it.
---
 ChangeLog                     | 13 +++++++
 doc/gnulib.texi               | 27 ++++++++++++-
 doc/posix-headers/assert.texi | 38 ++++++++++++-------
 m4/assert_h.m4                | 43 ++++++++++++++++-----
 modules/assert-h              |  2 +-
 modules/assert-h-tests        |  3 ++
 tests/test-assert.c           | 71 +++++++++++++++++++++++++++++++++++
 7 files changed, 172 insertions(+), 25 deletions(-)
 create mode 100644 tests/test-assert.c

diff --git a/ChangeLog b/ChangeLog
index d812e73f55..9e714143b9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2022-09-12  Paul Eggert  <eggert@cs.ucla.edu>
+
+	assert-h: static_assert is a keyword in C23
+	* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
+	keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
+	If not, arrange for config.h to #define static_assert
+	by including <assert.h>, and then do "#undef assert"
+	so that the assert macro still needs an explicit include.
+	This should be safe even on very old hosts, as assert.h
+	has been re-includable for decades.
+	* tests/tests-assert.c: New test.
+	* modules/assert-h-tests (Files, Makefile.am): Add it.
+
 2022-09-12  Bruno Haible  <bruno@clisp.org>
 
 	supersede: Avoid a failure when writing to /dev/null in Solaris zones.
diff --git a/doc/gnulib.texi b/doc/gnulib.texi
index e9c2fd8fa6..1bef2a0975 100644
--- a/doc/gnulib.texi
+++ b/doc/gnulib.texi
@@ -865,7 +865,8 @@ This chapter describes which keywords specified by ISO C are
 substituted by Gnulib.
 
 @menu
-* bool::  @code{bool}, @code{false}, and @code{true}
+* bool::           @code{bool}, @code{false}, and @code{true}
+* static_assert::  @code{static_assert}
 @end menu
 
 @node bool
@@ -889,6 +890,30 @@ On pre-C23 platforms, the keyword substitutes are macros.
 On pre-C23 platforms, the keyword substitutes assume C99 or later.
 @end itemize
 
+@node static_assert
+@section @code{static_assert}
+
+Gnulib module: assert-h
+
+The @code{assert-h} module arranges for both @code{static_assert} and
+@code{<assert.h>} to be like standard C@.  @xref{assert.h}.
+
+Portability problems fixed by Gnulib:
+@itemize
+@item
+Pre-C11 platforms lack @code{static_assert}.
+
+@item
+On pre-C23 platforms, @code{<assert.h>} must be included before
+using @code{static_assert}.
+@end itemize
+
+Portability problems not fixed by Gnulib:
+@itemize
+@item
+On pre-C23 platforms, @code{static_assert} is a macro.
+@end itemize
+
 @node Header File Substitutes
 @chapter ISO C and POSIX Header File Substitutes
 
diff --git a/doc/posix-headers/assert.texi b/doc/posix-headers/assert.texi
index 3392a1691a..5af0e8cb8f 100644
--- a/doc/posix-headers/assert.texi
+++ b/doc/posix-headers/assert.texi
@@ -10,28 +10,38 @@ See also the Gnulib modules @code{assert} and @code{verify}.
 Portability problems fixed by Gnulib:
 @itemize
 @item
-On older platforms @code{static_assert} and @code{_Static_assert} do
-not allow the second string-literal argument to be omitted.  For
-example, GCC versions before 9.1 do not support the single-argument
-@code{static_assert} that was standardized by C2x and C++17.
+On older C platforms @code{<assert.h>} must be included before using
+@code{static_assert}.  For example, GCC versions before 13 do not
+support the @code{static_assert} keyword that was standardized by C23.
 @item
-Even-older platforms do not support @code{static_assert} or
-@code{_Static_assert} at all.  For example, GCC versions before 4.6 do
-not support @code{_Static_assert}, and G++ versions before 4.3 do not
-support @code{static_assert}, which was standardized by C11 and C++11.
+On older platforms @code{static_assert} does not allow the second
+string-literal argument to be omitted.  For example, GCC versions
+before 9.1 do not support the single-argument @code{static_assert}
+that was standardized by C23 and C++17.
+@item
+Even-older platforms do not support @code{static_assert} at all.
+For example, GCC versions before 4.6 and G++ versions before 4.3
+do not support the two-argument form, which was standardized
+by C11 and C++11.
+@item
+Older C platforms might not support the obsolescent
+@code{_Static_assert} keyword or macro.
+This portability problem should not matter with code using this or the
+@code{static_assert} module, as such code should use
+@code{static_assert} instead.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
 @item
-C @code{_Static_assert} and C++ @code{static_assert}
-are keywords that can be used without including @code{<assert.h>}.
-The Gnulib substitutes are macros that require including @code{<assert.h>}.
-@item
-The C @code{static_assert} and @code{_Static_assert} can also
+A @code{static_assert} can also
 be used within a @code{struct} or @code{union} specifier, in place of
 an ordinary declaration of a member of the struct or union.  The
-Gnulib substitute can be used only as an ordinary declaration.
+Gnulib substitute can be used only as an ordinary declaration
+in code intended to be portable to C99 or earlier.
+@item
+In C23 and C++11 and later, @code{static_assert} is a keyword.
+In C11 and C17 it is a macro.  Any Gnulib substitute is also a macro.
 @item
 In C99 and later, @code{assert} can be applied to any scalar expression.
 In C89, the argument to @code{assert} is of type @code{int}.
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
index 7af15a2287..6300c859c7 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -12,18 +12,43 @@ AC_DEFUN([gl_ASSERT_H],
   AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
     [AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
-          [[#include <assert.h>
-            static_assert (2 + 2 == 4, "arithmetic doesn't work");
+          [[static_assert (2 + 2 == 4, "arithmetic does not work");
             static_assert (2 + 2 == 4);
           ]],
           [[
-            static_assert (sizeof (char) == 1, "sizeof doesn't work");
+            static_assert (sizeof (char) == 1, "sizeof does not work");
             static_assert (sizeof (char) == 1);
           ]])],
-       [gl_cv_static_assert=yes],
-       [gl_cv_static_assert=no])])
-  if test $gl_cv_static_assert = no; then
-    GL_GENERATE_ASSERT_H=true
-    gl_NEXT_HEADERS([assert.h])
-  fi
+       [gl_cv_static_assert="yes, a keyword"],
+       [AC_COMPILE_IFELSE(
+          [AC_LANG_PROGRAM(
+             [[#include <assert.h>
+               static_assert (2 + 2 == 4, "arithmetic does not work");
+               static_assert (2 + 2 == 4);
+             ]],
+             [[
+               static_assert (sizeof (char) == 1, "sizeof does not work");
+               static_assert (sizeof (char) == 1);
+             ]])],
+          [gl_cv_static_assert="yes, an <assert.h> macro"],
+          [gl_cv_static_assert=no])])])
+
+  AS_CASE([$gl_cv_static_assert],
+    [yes*keyword*],
+      [AC_DEFINE([HAVE_C_STATIC_ASSERT], [1],
+         [Define to 1 if the static_assert keyword works.])],
+    [no],
+      [GL_GENERATE_ASSERT_H=true
+       gl_NEXT_HEADERS([assert.h])])
+
+  dnl The "zz" puts this toward config.h's end, to avoid potential
+  dnl collisions with other definitions.  #undef assert so that
+  dnl programs are not tempted to use it without specifically
+  dnl including assert.h.  Break the #undef apart with a comment
+  dnl so that 'configure' does not comment it out.
+  AH_VERBATIM([zzstatic_assert],
+[#if !defined HAVE_C_STATIC_ASSERT && __cpp_static_assert < 201411
+ #include <assert.h>
+ #undef/**/assert
+#endif])
 ])
diff --git a/modules/assert-h b/modules/assert-h
index bf7565dc21..b67d44fe4a 100644
--- a/modules/assert-h
+++ b/modules/assert-h
@@ -1,5 +1,5 @@
 Description:
-An <assert.h> that conforms to C11.
+An <assert.h> and static_assert that are like C23.
 
 Files:
 lib/assert.in.h
diff --git a/modules/assert-h-tests b/modules/assert-h-tests
index 19375f61c3..670b06947c 100644
--- a/modules/assert-h-tests
+++ b/modules/assert-h-tests
@@ -1,7 +1,10 @@
 Files:
+tests/test-assert.c
 
 Depends-on:
 
 configure.ac:
 
 Makefile.am:
+TESTS += test-assert
+check_PROGRAMS += test-assert
diff --git a/tests/test-assert.c b/tests/test-assert.c
new file mode 100644
index 0000000000..45b0c0f457
--- /dev/null
+++ b/tests/test-assert.c
@@ -0,0 +1,71 @@
+/* Test assert.h and static_assert.
+   Copyright 2022 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#define STATIC_ASSERT_TESTS \
+  static_assert (2 + 2 == 4, "arithmetic does not work"); \
+  static_assert (2 + 2 == 4); \
+  static_assert (sizeof (char) == 1, "sizeof does not work"); \
+  static_assert (sizeof (char) == 1)
+
+STATIC_ASSERT_TESTS;
+
+static char const *
+assert (char const *p, int i)
+{
+  return p + i;
+}
+
+static char const *
+f (char const *p)
+{
+  return assert (p, 0);
+}
+
+#include <assert.h>
+
+STATIC_ASSERT_TESTS;
+
+static int
+g (void)
+{
+  assert (f ("this should work"));
+  return 0;
+}
+
+#define NDEBUG 1
+#include <assert.h>
+
+STATIC_ASSERT_TESTS;
+
+static int
+h (void)
+{
+  assert (f ("this should work"));
+  return 0;
+}
+
+int
+main (void)
+{
+  STATIC_ASSERT_TESTS;
+  g ();
+  h ();
+  return 0;
+}
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-13  3:32 [PROPOSED 0/2] static_assert and C23 Paul Eggert
  2022-09-13  3:32 ` [PROPOSED 1/2] assert-h: static_assert is a keyword in C23 Paul Eggert
@ 2022-09-13  3:32 ` Paul Eggert
  2022-09-14  1:05   ` Bruno Haible
                     ` (3 more replies)
  2022-09-13 22:50 ` [PROPOSED 0/2] static_assert and C23 Bruno Haible
  2 siblings, 4 replies; 13+ messages in thread
From: Paul Eggert @ 2022-09-13  3:32 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

Where it’s easy, prefer ‘static_assert’ to ‘verify’,
as this simplifies the source by removing the need to
include verify.h.  Keep using ‘verify’ if verify.h
is used for other reasons, or if code is shared with glibc.
* lib/alignalloc.c, lib/argmatch.h, lib/c32is-impl.h:
* lib/c32snrtombs.c, lib/c32srtombs.c, lib/exclude.c:
* lib/filevercmp.c, lib/fma.c, lib/i-ring.h, lib/ino-map.c:
* lib/localeinfo.c, lib/malloca.c, lib/mbrtoc32.c, lib/mbrtowc.c:
* lib/mbsinit.c, lib/mbsnrtoc32s.c, lib/mbsrtoc32s.c:
* lib/nanosleep.c, lib/parse-datetime.y, lib/pipe2.c:
* lib/rawmemchr.c, lib/relocwrapper.c, lib/sleep.c:
* lib/stat-w32.c, lib/strerror.c, lib/strtoimax.c:
* lib/utimecmp.c, lib/vasnprintf.c, tests/test-alignof.c:
* tests/test-intprops.c, tests/test-libgmp.c:
* tests/test-limits-h.c, tests/test-locale.c:
* tests/test-pthread.c, tests/test-round2.c:
* tests/test-stdalign.c, tests/test-stddef.c, tests/test-stdio.c:
* tests/test-stdlib.c, tests/test-string.c, tests/test-sys_stat.c:
* tests/test-time.c, tests/test-uchar.c, tests/test-unistd.c:
* tests/test-wchar.c:
Prefer static_assert to verify, and stop including verify.h.
* lib/stat.c: Don’t include verify.h (this include was unnecessary).
* modules/alignalloc, modules/alignof-tests, modules/argmatch:
* modules/c-vasnprintf, modules/c32isalnum, modules/c32isalpha:
* modules/c32isblank, modules/c32iscntrl, modules/c32isdigit:
* modules/c32isgraph, modules/c32islower, modules/c32isprint:
* modules/c32ispunct, modules/c32isspace, modules/c32isupper:
* modules/c32isxdigit, modules/c32snrtombs, modules/c32srtombs:
* modules/exclude, modules/filevercmp, modules/fma, modules/fmaf:
* modules/fmal, modules/fstat, modules/i-ring, modules/ino-map:
* modules/intprops-tests, modules/libgmp-tests:
* modules/limits-h-tests, modules/locale-tests, modules/malloca:
* modules/mbrtoc32, modules/mbrtowc, modules/mbsinit:
* modules/mbsnrtoc32s, modules/mbsrtoc32s, modules/nanosleep:
* modules/parse-datetime, modules/pipe2, modules/pthread-h-tests:
* modules/rawmemchr, modules/relocatable-prog-wrapper:
* modules/round-tests, modules/roundf-tests, modules/sleep:
* modules/stat, modules/stdalign-tests, modules/stdckdint-tests:
* modules/stddef-tests, modules/stdio-tests, modules/stdlib-tests:
* modules/strerror, modules/string-tests, modules/strtoimax:
* modules/strtoumax, modules/sys_stat-tests, modules/time-tests:
* modules/uchar-tests, modules/unistd-tests:
* modules/unistdio/u16-u16-vasnprintf:
* modules/unistdio/u16-vasnprintf:
* modules/unistdio/u32-u32-vasnprintf:
* modules/unistdio/u32-vasnprintf:
* modules/unistdio/u8-u8-vasnprintf:
* modules/unistdio/u8-vasnprintf, modules/unistdio/ulc-vasnprintf:
* modules/utimecmp, modules/vasnprintf, modules/wchar-tests:
Depend on assert-h, not verify.
---
 ChangeLog                           |  52 ++++++
 lib/alignalloc.c                    |   5 +-
 lib/argmatch.h                      |   4 +-
 lib/c32is-impl.h                    |   3 +-
 lib/c32snrtombs.c                   |   4 +-
 lib/c32srtombs.c                    |   4 +-
 lib/exclude.c                       |   9 +-
 lib/filevercmp.c                    |   3 +-
 lib/fma.c                           |   5 +-
 lib/i-ring.h                        |   3 +-
 lib/ino-map.c                       |   3 +-
 lib/localeinfo.c                    |   8 +-
 lib/malloca.c                       |   3 +-
 lib/mbrtoc32.c                      |   3 +-
 lib/mbrtowc.c                       |   3 +-
 lib/mbsinit.c                       |   3 +-
 lib/mbsnrtoc32s.c                   |   4 +-
 lib/mbsrtoc32s.c                    |   4 +-
 lib/nanosleep.c                     |   3 +-
 lib/parse-datetime.y                |   9 +-
 lib/pipe2.c                         |   3 +-
 lib/rawmemchr.c                     |   3 +-
 lib/relocwrapper.c                  |   3 +-
 lib/sleep.c                         |   4 +-
 lib/stat-w32.c                      |   3 +-
 lib/stat.c                          |   1 -
 lib/strerror.c                      |   3 +-
 lib/strtoimax.c                     |   6 +-
 lib/utimecmp.c                      |   3 +-
 lib/vasnprintf.c                    |  11 +-
 modules/alignalloc                  |   2 +-
 modules/alignof-tests               |   3 +-
 modules/argmatch                    |   2 +-
 modules/c-vasnprintf                |   2 +-
 modules/c32isalnum                  |   2 +-
 modules/c32isalpha                  |   2 +-
 modules/c32isblank                  |   2 +-
 modules/c32iscntrl                  |   2 +-
 modules/c32isdigit                  |   2 +-
 modules/c32isgraph                  |   2 +-
 modules/c32islower                  |   2 +-
 modules/c32isprint                  |   2 +-
 modules/c32ispunct                  |   2 +-
 modules/c32isspace                  |   2 +-
 modules/c32isupper                  |   2 +-
 modules/c32isxdigit                 |   2 +-
 modules/c32snrtombs                 |   2 +-
 modules/c32srtombs                  |   2 +-
 modules/exclude                     |   2 +-
 modules/filevercmp                  |   2 +-
 modules/fma                         |   2 +-
 modules/fmaf                        |   2 +-
 modules/fmal                        |   2 +-
 modules/fstat                       |   2 +-
 modules/i-ring                      |   2 +-
 modules/ino-map                     |   2 +-
 modules/intprops-tests              |   2 +-
 modules/libgmp-tests                |   2 +-
 modules/limits-h-tests              |   2 +-
 modules/locale-tests                |   2 +-
 modules/malloca                     |   2 +-
 modules/mbrtoc32                    |   2 +-
 modules/mbrtowc                     |   2 +-
 modules/mbsinit                     |   2 +-
 modules/mbsnrtoc32s                 |   2 +-
 modules/mbsrtoc32s                  |   2 +-
 modules/nanosleep                   |   2 +-
 modules/parse-datetime              |   2 +-
 modules/pipe2                       |   2 +-
 modules/pthread-h-tests             |   2 +-
 modules/rawmemchr                   |   2 +-
 modules/relocatable-prog-wrapper    |   2 +-
 modules/round-tests                 |   2 +-
 modules/roundf-tests                |   2 +-
 modules/sleep                       |   2 +-
 modules/stat                        |   2 +-
 modules/stdalign-tests              |   2 +-
 modules/stdckdint-tests             |   2 +-
 modules/stddef-tests                |   2 +-
 modules/stdio-tests                 |   2 +-
 modules/stdlib-tests                |   2 +-
 modules/strerror                    |   2 +-
 modules/string-tests                |   2 +-
 modules/strtoimax                   |   2 +-
 modules/strtoumax                   |   2 +-
 modules/sys_stat-tests              |   2 +-
 modules/time-tests                  |   2 +-
 modules/uchar-tests                 |   2 +-
 modules/unistd-tests                |   2 +-
 modules/unistdio/u16-u16-vasnprintf |   2 +-
 modules/unistdio/u16-vasnprintf     |   2 +-
 modules/unistdio/u32-u32-vasnprintf |   2 +-
 modules/unistdio/u32-vasnprintf     |   2 +-
 modules/unistdio/u8-u8-vasnprintf   |   2 +-
 modules/unistdio/u8-vasnprintf      |   2 +-
 modules/unistdio/ulc-vasnprintf     |   2 +-
 modules/utimecmp                    |   2 +-
 modules/vasnprintf                  |   2 +-
 modules/wchar-tests                 |   2 +-
 tests/test-alignof.c                |   4 +-
 tests/test-intprops.c               |   3 +-
 tests/test-libgmp.c                 |   4 +-
 tests/test-limits-h.c               |  50 +++--
 tests/test-locale.c                 |   4 +-
 tests/test-pthread.c                |   2 -
 tests/test-round2.c                 |   4 +-
 tests/test-stdalign.c               |  10 +-
 tests/test-stddef.c                 |  43 +++--
 tests/test-stdio.c                  |   4 +-
 tests/test-stdlib.c                 |   4 +-
 tests/test-string.c                 |   4 +-
 tests/test-sys_stat.c               | 276 ++++++++++++++--------------
 tests/test-time.c                   |   6 +-
 tests/test-uchar.c                  |  12 +-
 tests/test-unistd.c                 |   4 +-
 tests/test-wchar.c                  |   4 +-
 116 files changed, 368 insertions(+), 384 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 9e714143b9..8d20e0fae3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,57 @@
 2022-09-12  Paul Eggert  <eggert@cs.ucla.edu>
 
+	assert-h: prefer to ‘verify’
+	Where it’s easy, prefer ‘static_assert’ to ‘verify’,
+	as this simplifies the source by removing the need to
+	include verify.h.  Keep using ‘verify’ if verify.h
+	is used for other reasons, or if code is shared with glibc.
+	* lib/alignalloc.c, lib/argmatch.h, lib/c32is-impl.h:
+	* lib/c32snrtombs.c, lib/c32srtombs.c, lib/exclude.c:
+	* lib/filevercmp.c, lib/fma.c, lib/i-ring.h, lib/ino-map.c:
+	* lib/localeinfo.c, lib/malloca.c, lib/mbrtoc32.c, lib/mbrtowc.c:
+	* lib/mbsinit.c, lib/mbsnrtoc32s.c, lib/mbsrtoc32s.c:
+	* lib/nanosleep.c, lib/parse-datetime.y, lib/pipe2.c:
+	* lib/rawmemchr.c, lib/relocwrapper.c, lib/sleep.c:
+	* lib/stat-w32.c, lib/strerror.c, lib/strtoimax.c:
+	* lib/utimecmp.c, lib/vasnprintf.c, tests/test-alignof.c:
+	* tests/test-intprops.c, tests/test-libgmp.c:
+	* tests/test-limits-h.c, tests/test-locale.c:
+	* tests/test-pthread.c, tests/test-round2.c:
+	* tests/test-stdalign.c, tests/test-stddef.c, tests/test-stdio.c:
+	* tests/test-stdlib.c, tests/test-string.c, tests/test-sys_stat.c:
+	* tests/test-time.c, tests/test-uchar.c, tests/test-unistd.c:
+	* tests/test-wchar.c:
+	Prefer static_assert to verify, and stop including verify.h.
+	* lib/stat.c: Don’t include verify.h (this include was unnecessary).
+	* modules/alignalloc, modules/alignof-tests, modules/argmatch:
+	* modules/c-vasnprintf, modules/c32isalnum, modules/c32isalpha:
+	* modules/c32isblank, modules/c32iscntrl, modules/c32isdigit:
+	* modules/c32isgraph, modules/c32islower, modules/c32isprint:
+	* modules/c32ispunct, modules/c32isspace, modules/c32isupper:
+	* modules/c32isxdigit, modules/c32snrtombs, modules/c32srtombs:
+	* modules/exclude, modules/filevercmp, modules/fma, modules/fmaf:
+	* modules/fmal, modules/fstat, modules/i-ring, modules/ino-map:
+	* modules/intprops-tests, modules/libgmp-tests:
+	* modules/limits-h-tests, modules/locale-tests, modules/malloca:
+	* modules/mbrtoc32, modules/mbrtowc, modules/mbsinit:
+	* modules/mbsnrtoc32s, modules/mbsrtoc32s, modules/nanosleep:
+	* modules/parse-datetime, modules/pipe2, modules/pthread-h-tests:
+	* modules/rawmemchr, modules/relocatable-prog-wrapper:
+	* modules/round-tests, modules/roundf-tests, modules/sleep:
+	* modules/stat, modules/stdalign-tests, modules/stdckdint-tests:
+	* modules/stddef-tests, modules/stdio-tests, modules/stdlib-tests:
+	* modules/strerror, modules/string-tests, modules/strtoimax:
+	* modules/strtoumax, modules/sys_stat-tests, modules/time-tests:
+	* modules/uchar-tests, modules/unistd-tests:
+	* modules/unistdio/u16-u16-vasnprintf:
+	* modules/unistdio/u16-vasnprintf:
+	* modules/unistdio/u32-u32-vasnprintf:
+	* modules/unistdio/u32-vasnprintf:
+	* modules/unistdio/u8-u8-vasnprintf:
+	* modules/unistdio/u8-vasnprintf, modules/unistdio/ulc-vasnprintf:
+	* modules/utimecmp, modules/vasnprintf, modules/wchar-tests:
+	Depend on assert-h, not verify.
+
 	assert-h: static_assert is a keyword in C23
 	* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
 	keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
diff --git a/lib/alignalloc.c b/lib/alignalloc.c
index 1884394e3c..1be5d4d2ba 100644
--- a/lib/alignalloc.c
+++ b/lib/alignalloc.c
@@ -26,7 +26,6 @@
 #include <stdalign.h>
 #include <stdckdint.h>
 #include <stdint.h>
-#include "verify.h"
 
 #if !ALIGNALLOC_VIA_ALIGNED_ALLOC
 # if HAVE_POSIX_MEMALIGN
@@ -37,7 +36,7 @@
    sizeof (void *) is a power of two, which is true on all known platforms.
    This check is here rather than in alignalloc.h to save the compiler
    the trouble of checking it each time alignalloc.h is included.  */
-verify (! (sizeof (void *) & (sizeof (void *) - 1)));
+static_assert (! (sizeof (void *) & (sizeof (void *) - 1)));
 
 # else /* !HAVE_POSIX_MEMALIGN */
 
@@ -62,7 +61,7 @@ address_of_pointer_to_malloced (unsigned char *r)
      for a 0 byte at R - 1.  This approach assumes UCHAR_MAX is large
      enough so that there is room for P; although true on all
      plausible platforms, check the assumption to be safe.  */
-  verify (sizeof (void *) + alignof (void *) - 1 <= UCHAR_MAX);
+  static_assert (sizeof (void *) + alignof (void *) - 1 <= UCHAR_MAX);
 
   return align_down (r - 1 - sizeof (void *), alignof (void *));
 }
diff --git a/lib/argmatch.h b/lib/argmatch.h
index 846cff9066..db98187d7f 100644
--- a/lib/argmatch.h
+++ b/lib/argmatch.h
@@ -29,7 +29,6 @@
 
 # include "gettext.h"
 # include "quote.h"
-# include "verify.h"
 
 # ifdef  __cplusplus
 extern "C" {
@@ -41,7 +40,8 @@ extern "C" {
    (argument list ends with a NULL guard).  */
 
 # define ARGMATCH_VERIFY(Arglist, Vallist) \
-    verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1)
+    static_assert (ARRAY_CARDINALITY (Arglist) \
+                   == ARRAY_CARDINALITY (Vallist) + 1)
 
 /* Return the index of the element of ARGLIST (NULL terminated) that
    matches with ARG.  If VALLIST is not NULL, then use it to resolve
diff --git a/lib/c32is-impl.h b/lib/c32is-impl.h
index 6b910fafbf..ed3758c9e0 100644
--- a/lib/c32is-impl.h
+++ b/lib/c32is-impl.h
@@ -37,7 +37,6 @@
 #endif
 
 #include "unictype.h"
-#include "verify.h"
 
 int
 FUNC (wint_t wc)
@@ -96,7 +95,7 @@ FUNC (wint_t wc)
 
 #else /* macOS, FreeBSD, NetBSD, OpenBSD, HP-UX, Solaris, Minix, Android */
   /* char32_t and wchar_t are equivalent.  */
-  verify (sizeof (char32_t) == sizeof (wchar_t));
+  static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
   return WCHAR_FUNC (wc);
 #endif
diff --git a/lib/c32snrtombs.c b/lib/c32snrtombs.c
index 6bbc65dad0..4b3b40a8f6 100644
--- a/lib/c32snrtombs.c
+++ b/lib/c32snrtombs.c
@@ -42,9 +42,7 @@ extern mbstate_t _gl_c32srtombs_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 c32snrtombs (char *dest, const char32_t **srcp, size_t srclen, size_t len,
diff --git a/lib/c32srtombs.c b/lib/c32srtombs.c
index d7480659a1..6f08deb234 100644
--- a/lib/c32srtombs.c
+++ b/lib/c32srtombs.c
@@ -42,9 +42,7 @@ extern mbstate_t _gl_c32srtombs_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 c32srtombs (char *dest, const char32_t **srcp, size_t len, mbstate_t *ps)
diff --git a/lib/exclude.c b/lib/exclude.c
index a39df312f2..4b96dbfc3f 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -37,7 +37,6 @@
 #include "mbuiter.h"
 #include "fnmatch.h"
 #include "xalloc.h"
-#include "verify.h"
 #include "filename.h"
 
 #if GNULIB_EXCLUDE_SINGLE_THREAD
@@ -55,10 +54,10 @@
 # define FNM_LEADING_DIR 0
 #endif
 
-verify (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
-         & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
-            | FNM_CASEFOLD | FNM_EXTMATCH))
-        == 0);
+static_assert (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
+                & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
+                   | FNM_CASEFOLD | FNM_EXTMATCH))
+               == 0);
 
 
 /* Exclusion patterns are grouped into a singly-linked list of
diff --git a/lib/filevercmp.c b/lib/filevercmp.c
index cb1b38d473..844505a6bf 100644
--- a/lib/filevercmp.c
+++ b/lib/filevercmp.c
@@ -23,7 +23,6 @@
 #include <c-ctype.h>
 #include <limits.h>
 #include <idx.h>
-#include <verify.h>
 
 /* Return the length of a prefix of S that corresponds to the suffix
    defined by this extended regular expression in the C locale:
@@ -74,7 +73,7 @@ order (char const *s, idx_t pos, idx_t len)
     return -2;
   else
     {
-      verify (UCHAR_MAX <= (INT_MAX - 1 - 2) / 2);
+      static_assert (UCHAR_MAX <= (INT_MAX - 1 - 2) / 2);
       return c + UCHAR_MAX + 1;
     }
 }
diff --git a/lib/fma.c b/lib/fma.c
index 25a41c485f..55f4fcdc98 100644
--- a/lib/fma.c
+++ b/lib/fma.c
@@ -32,7 +32,6 @@
 
 #include "float+.h"
 #include "integer_length.h"
-#include "verify.h"
 
 #ifdef USE_LONG_DOUBLE
 # define FUNC fmal
@@ -94,11 +93,11 @@
 
 typedef unsigned int mp_limb_t;
 #define GMP_LIMB_BITS 32
-verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
 
 typedef unsigned long long mp_twolimb_t;
 #define GMP_TWOLIMB_BITS 64
-verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
 
 /* Number of limbs needed for a single DOUBLE.  */
 #define NLIMBS1 ((MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS)
diff --git a/lib/i-ring.h b/lib/i-ring.h
index ec27d5a3f4..d4efb9726d 100644
--- a/lib/i-ring.h
+++ b/lib/i-ring.h
@@ -14,10 +14,9 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-#include "verify.h"
 
 enum { I_RING_SIZE = 4 };
-verify (1 <= I_RING_SIZE);
+static_assert (1 <= I_RING_SIZE);
 
 /* When ir_empty is true, the ring is empty.
    Otherwise, ir_data[B..F] are defined, where B..F is the contiguous
diff --git a/lib/ino-map.c b/lib/ino-map.c
index d9c56a0fa4..9a97391b8a 100644
--- a/lib/ino-map.c
+++ b/lib/ino-map.c
@@ -21,7 +21,6 @@
 #include "ino-map.h"
 
 #include "hash.h"
-#include "verify.h"
 
 #include <limits.h>
 #include <stdlib.h>
@@ -151,7 +150,7 @@ ino_map_insert (struct ino_map *im, ino_t ino)
          overflow to zero, then it must equal INO_MAP_INSERT_FAILURE,
          which is the value that should be returned in that case.
          Verify that this works.  */
-      verify (INO_MAP_INSERT_FAILURE + 1 == 0);
+      static_assert (INO_MAP_INSERT_FAILURE + 1 == 0);
 
       /* Prepare to allocate a new probe next time; this one is in use.  */
       im->probe = NULL;
diff --git a/lib/localeinfo.c b/lib/localeinfo.c
index 0e74f4220f..34c020cdc6 100644
--- a/lib/localeinfo.c
+++ b/lib/localeinfo.c
@@ -23,8 +23,6 @@
 
 #include <localeinfo.h>
 
-#include <verify.h>
-
 #include <limits.h>
 #include <locale.h>
 #include <stdlib.h>
@@ -32,7 +30,7 @@
 #include <wctype.h>
 
 /* The sbclen implementation relies on this.  */
-verify (MB_LEN_MAX <= SCHAR_MAX);
+static_assert (MB_LEN_MAX <= SCHAR_MAX);
 
 /* Return true if the locale uses UTF-8.  */
 
@@ -123,8 +121,8 @@ static short const lonesome_lower[] =
 
 /* Verify that the worst case fits.  This is 1 for towupper, 1 for
    towlower, and 1 for each entry in LONESOME_LOWER.  */
-verify (1 + 1 + sizeof lonesome_lower / sizeof *lonesome_lower
-        <= CASE_FOLDED_BUFSIZE);
+static_assert (1 + 1 + sizeof lonesome_lower / sizeof *lonesome_lower
+               <= CASE_FOLDED_BUFSIZE);
 
 /* Find the characters equal to C after case-folding, other than C
    itself, and store them into FOLDED.  Return the number of characters
diff --git a/lib/malloca.c b/lib/malloca.c
index 183783a710..1e19978d90 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -24,7 +24,6 @@
 #include <stdckdint.h>
 
 #include "idx.h"
-#include "verify.h"
 
 /* The speed critical point in this file is freea() applied to an alloca()
    result: it must be fast, to match the speed of alloca().  The speed of
@@ -40,7 +39,7 @@
 /* Type for holding very small pointer differences.  */
 typedef unsigned char small_t;
 /* Verify that it is wide enough.  */
-verify (2 * sa_alignment_max - 1 <= (small_t) -1);
+static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
 
 void *
 mmalloca (size_t n)
diff --git a/lib/mbrtoc32.c b/lib/mbrtoc32.c
index 6d09fe6db4..8f8095295d 100644
--- a/lib/mbrtoc32.c
+++ b/lib/mbrtoc32.c
@@ -52,11 +52,10 @@
 
 # endif
 
-# include "verify.h"
 # include "lc-charset-dispatch.h"
 # include "mbtowc-lock.h"
 
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
 static char internal_state[4];
 
 size_t
diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c
index 4b164edd40..be6fdc6478 100644
--- a/lib/mbrtowc.c
+++ b/lib/mbrtowc.c
@@ -51,11 +51,10 @@
 # endif
 
 # include "attribute.h"
-# include "verify.h"
 # include "lc-charset-dispatch.h"
 # include "mbtowc-lock.h"
 
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
 static char internal_state[4];
 
 size_t
diff --git a/lib/mbsinit.c b/lib/mbsinit.c
index 9621defc73..2324f15680 100644
--- a/lib/mbsinit.c
+++ b/lib/mbsinit.c
@@ -20,7 +20,6 @@
 /* Specification.  */
 #include <wchar.h>
 
-#include "verify.h"
 
 #if GNULIB_defined_mbstate_t
 
@@ -39,7 +38,7 @@
      - In wc -> mb direction, mbstate_t contains no information. In other
        words, it is always in the initial state.  */
 
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
 
 int
 mbsinit (const mbstate_t *ps)
diff --git a/lib/mbsnrtoc32s.c b/lib/mbsnrtoc32s.c
index 8d44d0e13f..391baee449 100644
--- a/lib/mbsnrtoc32s.c
+++ b/lib/mbsnrtoc32s.c
@@ -51,9 +51,7 @@ extern mbstate_t _gl_mbsrtoc32s_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 mbsnrtoc32s (char32_t *dest, const char **srcp, size_t srclen, size_t len,
diff --git a/lib/mbsrtoc32s.c b/lib/mbsrtoc32s.c
index 6001b0bbf3..1cd0dd0ad1 100644
--- a/lib/mbsrtoc32s.c
+++ b/lib/mbsrtoc32s.c
@@ -43,9 +43,7 @@ extern mbstate_t _gl_mbsrtoc32s_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 mbsrtoc32s (char32_t *dest, const char **srcp, size_t len, mbstate_t *ps)
diff --git a/lib/nanosleep.c b/lib/nanosleep.c
index 78e612d4b1..55d6fa650e 100644
--- a/lib/nanosleep.c
+++ b/lib/nanosleep.c
@@ -23,7 +23,6 @@
 #include <time.h>
 
 #include "intprops.h"
-#include "verify.h"
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -58,7 +57,7 @@ nanosleep (const struct timespec *requested_delay,
 
   {
     /* Verify that time_t is large enough.  */
-    verify (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
+    static_assert (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
     const time_t limit = 24 * 24 * 60 * 60;
     time_t seconds = requested_delay->tv_sec;
     struct timespec intermediate;
diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
index 0903c2003e..066d414c29 100644
--- a/lib/parse-datetime.y
+++ b/lib/parse-datetime.y
@@ -38,7 +38,6 @@
 #include "idx.h"
 #include "intprops.h"
 #include "timespec.h"
-#include "verify.h"
 #include "strftime.h"
 
 /* There's no need to extend the stack, so there's no need to involve
@@ -94,9 +93,9 @@
 /* Verify that time_t is an integer as POSIX requires, and that every
    time_t value fits in intmax_t.  Please file a bug report if these
    assumptions are false on your platform.  */
-verify (TYPE_IS_INTEGER (time_t));
-verify (!TYPE_SIGNED (time_t) || INTMAX_MIN <= TYPE_MINIMUM (time_t));
-verify (TYPE_MAXIMUM (time_t) <= INTMAX_MAX);
+static_assert (TYPE_IS_INTEGER (time_t));
+static_assert (!TYPE_SIGNED (time_t) || INTMAX_MIN <= TYPE_MINIMUM (time_t));
+static_assert (TYPE_MAXIMUM (time_t) <= INTMAX_MAX);
 
 /* True if N is out of range for time_t.  */
 static bool
@@ -1253,7 +1252,7 @@ enum { TM_YEAR_BUFSIZE = INT_BUFSIZE_BOUND (int) + 1 };
 static char const *
 tm_year_str (int tm_year, char buf[TM_YEAR_BUFSIZE])
 {
-  verify (TM_YEAR_BASE % 100 == 0);
+  static_assert (TM_YEAR_BASE % 100 == 0);
   sprintf (buf, &"-%02d%02d"[-TM_YEAR_BASE <= tm_year],
            abs (tm_year / 100 + TM_YEAR_BASE / 100),
            abs (tm_year % 100));
diff --git a/lib/pipe2.c b/lib/pipe2.c
index 400aff001a..a3cbb7f261 100644
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -23,7 +23,6 @@
 #include <fcntl.h>
 
 #include "binary-io.h"
-#include "verify.h"
 
 #if GNULIB_defined_O_NONBLOCK
 # include "nonblocking.h"
@@ -95,7 +94,7 @@ pipe2 (int fd[2], int flags)
     }
 # else
   {
-    verify (O_NONBLOCK == 0);
+    static_assert (O_NONBLOCK == 0);
   }
 # endif
 
diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c
index ea68c1bfc6..c789599db8 100644
--- a/lib/rawmemchr.c
+++ b/lib/rawmemchr.c
@@ -26,7 +26,6 @@
 # include <stdalign.h>
 # include <stdint.h>
 
-# include "verify.h"
 
 /* Find the first occurrence of C in S.  */
 void *
@@ -36,7 +35,7 @@ rawmemchr (const void *s, int c_in)
   typedef uintptr_t longword;
   /* If you change the "uintptr_t", you should change UINTPTR_WIDTH to match.
      This verifies that the type does not have padding bits.  */
-  verify (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
+  static_assert (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
 
   const unsigned char *char_ptr;
   unsigned char c = c_in;
diff --git a/lib/relocwrapper.c b/lib/relocwrapper.c
index 3ec8b2888b..9ef115300a 100644
--- a/lib/relocwrapper.c
+++ b/lib/relocwrapper.c
@@ -81,7 +81,6 @@
 #include "progname.h"
 #include "relocatable.h"
 #include "c-ctype.h"
-#include "verify.h"
 
 /* Use the system functions, not the gnulib overrides in this file.  */
 #undef fprintf
@@ -142,7 +141,7 @@ add_dotbin (const char *filename)
 /* List of directories that contain the libraries.  */
 static const char *libdirs[] = { LIBDIRS NULL };
 /* Verify that at least one directory is given.  */
-verify (sizeof (libdirs) / sizeof (libdirs[0]) > 1);
+static_assert (sizeof (libdirs) / sizeof (libdirs[0]) > 1);
 
 /* Relocate the list of directories that contain the libraries.  */
 static void
diff --git a/lib/sleep.c b/lib/sleep.c
index 7a6fb152a7..80431c1081 100644
--- a/lib/sleep.c
+++ b/lib/sleep.c
@@ -22,8 +22,6 @@
 
 #include <limits.h>
 
-#include "verify.h"
-
 #if defined _WIN32 && ! defined __CYGWIN__
 
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
@@ -56,7 +54,7 @@ unsigned int
 rpl_sleep (unsigned int seconds)
 {
   /* This requires int larger than 16 bits.  */
-  verify (UINT_MAX / 24 / 24 / 60 / 60);
+  static_assert (UINT_MAX / 24 / 24 / 60 / 60);
   const unsigned int limit = 24 * 24 * 60 * 60;
   while (limit < seconds)
     {
diff --git a/lib/stat-w32.c b/lib/stat-w32.c
index c1a2923977..e61b75c6e9 100644
--- a/lib/stat-w32.c
+++ b/lib/stat-w32.c
@@ -50,7 +50,6 @@
 #include "stat-w32.h"
 
 #include "pathmax.h"
-#include "verify.h"
 
 /* Don't assume that UNICODE is not defined.  */
 #undef LoadLibrary
@@ -228,7 +227,7 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
           if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id)))
             {
               buf->st_dev = id.VolumeSerialNumber;
-              verify (sizeof (ino_t) == sizeof (id.FileId));
+              static_assert (sizeof (ino_t) == sizeof (id.FileId));
               memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t));
               goto ino_done;
             }
diff --git a/lib/stat.c b/lib/stat.c
index cdcc33165f..adb6123352 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -58,7 +58,6 @@ orig_stat (const char *filename, struct stat *buf)
 #include <string.h>
 #include "filename.h"
 #include "malloca.h"
-#include "verify.h"
 
 #ifdef WINDOWS_NATIVE
 # define WIN32_LEAN_AND_MEAN
diff --git a/lib/strerror.c b/lib/strerror.c
index 67c5216e21..1019fe9eb6 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -27,7 +27,6 @@
 
 #include "intprops.h"
 #include "strerror-override.h"
-#include "verify.h"
 
 /* Use the system functions, not the gnulib overrides in this file.  */
 #undef sprintf
@@ -55,7 +54,7 @@ strerror (int n)
   if (!msg || !*msg)
     {
       static char const fmt[] = "Unknown error %d";
-      verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+      static_assert (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
       sprintf (buf, fmt, n);
       errno = EINVAL;
       return buf;
diff --git a/lib/strtoimax.c b/lib/strtoimax.c
index cad12d0d9b..29d16d29ce 100644
--- a/lib/strtoimax.c
+++ b/lib/strtoimax.c
@@ -25,8 +25,6 @@
 
 #include <stdlib.h>
 
-#include "verify.h"
-
 #ifdef UNSIGNED
 # ifndef HAVE_DECL_STRTOULL
 "this configure-time declaration test was not run"
@@ -62,8 +60,8 @@ long long int strtoll (char const *, char **, int);
 Int
 Strtoimax (char const *ptr, char **endptr, int base)
 {
-  verify (sizeof (Int) == sizeof (Unsigned long int)
-          || sizeof (Int) == sizeof (Unsigned long long int));
+  static_assert (sizeof (Int) == sizeof (Unsigned long int)
+                 || sizeof (Int) == sizeof (Unsigned long long int));
 
   if (sizeof (Int) != sizeof (Unsigned long int))
     return Strtoll (ptr, endptr, base);
diff --git a/lib/utimecmp.c b/lib/utimecmp.c
index 7312ee0b88..ae7729d26b 100644
--- a/lib/utimecmp.c
+++ b/lib/utimecmp.c
@@ -33,7 +33,6 @@
 #include "hash.h"
 #include "intprops.h"
 #include "stat-time.h"
-#include "verify.h"
 
 #ifndef MAX
 # define MAX(a, b) ((a) > (b) ? (a) : (b))
@@ -146,7 +145,7 @@ utimecmpat (int dfd, char const *dst_name,
 
      time_t might be unsigned.  */
 
-  verify (TYPE_IS_INTEGER (time_t));
+  static_assert (TYPE_IS_INTEGER (time_t));
 
   /* Destination and source timestamps.  */
   time_t dst_s = dst_stat->st_mtime;
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 285c674b9c..01d18bf598 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -101,7 +101,6 @@
 #include "xsize.h"
 
 #include "attribute.h"
-#include "verify.h"
 
 #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
 # include <math.h>
@@ -408,11 +407,11 @@ is_infinite_or_zerol (long double x)
 
 typedef unsigned int mp_limb_t;
 # define GMP_LIMB_BITS 32
-verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
 
 typedef unsigned long long mp_twolimb_t;
 # define GMP_TWOLIMB_BITS 64
-verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
 
 /* Representation of a bignum >= 0.  */
 typedef struct
@@ -2628,7 +2627,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   size_t characters;
 #  if !DCHAR_IS_TCHAR
                   /* This code assumes that TCHAR_T is 'char'.  */
-                  verify (sizeof (TCHAR_T) == 1);
+                  static_assert (sizeof (TCHAR_T) == 1);
                   TCHAR_T *tmpsrc;
                   DCHAR_T *tmpdst;
                   size_t tmpdst_len;
@@ -2894,7 +2893,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   size_t characters;
 # if !DCHAR_IS_TCHAR
                   /* This code assumes that TCHAR_T is 'char'.  */
-                  verify (sizeof (TCHAR_T) == 1);
+                  static_assert (sizeof (TCHAR_T) == 1);
                   TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64.  */
                   DCHAR_T *tmpdst;
                   size_t tmpdst_len;
@@ -5451,7 +5450,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                         DCHAR_T *tmpdst;
                         size_t tmpdst_len;
                         /* This code assumes that TCHAR_T is 'char'.  */
-                        verify (sizeof (TCHAR_T) == 1);
+                        static_assert (sizeof (TCHAR_T) == 1);
 # if USE_SNPRINTF
                         tmpsrc = (TCHAR_T *) (result + length);
 # else
diff --git a/modules/alignalloc b/modules/alignalloc
index 42ca672bc2..0a34b4bcf4 100644
--- a/modules/alignalloc
+++ b/modules/alignalloc
@@ -7,6 +7,7 @@ lib/alignalloc.c
 m4/alignalloc.m4
 
 Depends-on:
+assert-h
 extensions
 extern-inline
 idx
@@ -14,7 +15,6 @@ posix_memalign
 stdalign
 stdckdint
 stdint
-verify
 
 configure.ac:
 gl_ALIGNALLOC
diff --git a/modules/alignof-tests b/modules/alignof-tests
index be4cb942be..598351790e 100644
--- a/modules/alignof-tests
+++ b/modules/alignof-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-alignof.c
 
 Depends-on:
-verify
+assert-h
 stdint
 
 configure.ac:
@@ -10,4 +10,3 @@ configure.ac:
 Makefile.am:
 TESTS += test-alignof
 check_PROGRAMS += test-alignof
-
diff --git a/modules/argmatch b/modules/argmatch
index 97d84fbb93..bd534f5056 100644
--- a/modules/argmatch
+++ b/modules/argmatch
@@ -6,6 +6,7 @@ lib/argmatch.h
 lib/argmatch.c
 
 Depends-on:
+assert-h
 c99
 error
 exitfail
@@ -16,7 +17,6 @@ quote
 quotearg
 stdbool
 stdlib
-verify
 
 configure.ac:
 
diff --git a/modules/c-vasnprintf b/modules/c-vasnprintf
index f193f70856..44259c1f0e 100644
--- a/modules/c-vasnprintf
+++ b/modules/c-vasnprintf
@@ -22,6 +22,7 @@ m4/math_h.m4
 m4/exponentd.m4
 
 Depends-on:
+assert-h
 attribute
 stdio
 isnand-nolibm
@@ -39,7 +40,6 @@ xsize
 errno
 memchr
 multiarch
-verify
 
 configure.ac:
 AC_REQUIRE([AC_C_RESTRICT])
diff --git a/modules/c32isalnum b/modules/c32isalnum
index b03ba7fbc3..a6e42fefd4 100644
--- a/modules/c32isalnum
+++ b/modules/c32isalnum
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-alnum
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isalpha b/modules/c32isalpha
index d39e869471..8081cc2671 100644
--- a/modules/c32isalpha
+++ b/modules/c32isalpha
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-alpha
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isblank b/modules/c32isblank
index 948ae36212..1d3938b754 100644
--- a/modules/c32isblank
+++ b/modules/c32isblank
@@ -14,7 +14,7 @@ iswblank
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-blank
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32iscntrl b/modules/c32iscntrl
index b3f1ac7dbb..9ec924f96a 100644
--- a/modules/c32iscntrl
+++ b/modules/c32iscntrl
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-cntrl
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isdigit b/modules/c32isdigit
index 3b82dc91b2..a9449cd6b1 100644
--- a/modules/c32isdigit
+++ b/modules/c32isdigit
@@ -14,7 +14,7 @@ iswdigit
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-digit
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isgraph b/modules/c32isgraph
index 30dc8cb2cd..6d6ef2785a 100644
--- a/modules/c32isgraph
+++ b/modules/c32isgraph
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-graph
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32islower b/modules/c32islower
index eb075f3b80..1659125631 100644
--- a/modules/c32islower
+++ b/modules/c32islower
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-lower
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isprint b/modules/c32isprint
index db7bedc980..96049e3878 100644
--- a/modules/c32isprint
+++ b/modules/c32isprint
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-print
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32ispunct b/modules/c32ispunct
index 2b132dc0b4..1e45a01a38 100644
--- a/modules/c32ispunct
+++ b/modules/c32ispunct
@@ -14,7 +14,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-punct
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isspace b/modules/c32isspace
index 144aa9b5fc..f72b6ec27b 100644
--- a/modules/c32isspace
+++ b/modules/c32isspace
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-space
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isupper b/modules/c32isupper
index 26bc18d51f..09d41ad2ec 100644
--- a/modules/c32isupper
+++ b/modules/c32isupper
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-upper
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isxdigit b/modules/c32isxdigit
index f4f31c44d9..2cc4b3e21b 100644
--- a/modules/c32isxdigit
+++ b/modules/c32isxdigit
@@ -15,7 +15,7 @@ iswxdigit
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-xdigit
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32snrtombs b/modules/c32snrtombs
index 4ced9f2628..6edf7174ed 100644
--- a/modules/c32snrtombs
+++ b/modules/c32snrtombs
@@ -9,7 +9,7 @@ lib/c32srtombs-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 c32rtomb
 wcsnrtombs      [test $SMALL_WCHAR_T = 0]
 
diff --git a/modules/c32srtombs b/modules/c32srtombs
index 1f36b6cc66..4d82ab7bdc 100644
--- a/modules/c32srtombs
+++ b/modules/c32srtombs
@@ -9,7 +9,7 @@ lib/c32srtombs-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 c32rtomb
 wcsrtombs       [test $SMALL_WCHAR_T = 0]
 
diff --git a/modules/exclude b/modules/exclude
index 13871bd635..bd785cada9 100644
--- a/modules/exclude
+++ b/modules/exclude
@@ -6,6 +6,7 @@ lib/exclude.h
 lib/exclude.c
 
 Depends-on:
+assert-h
 filename
 fnmatch
 fopen-gnu
@@ -15,7 +16,6 @@ mbuiter
 regex
 stdbool
 unlocked-io-internal
-verify
 xalloc
 
 configure.ac:
diff --git a/modules/filevercmp b/modules/filevercmp
index 4786ce11b6..6c11bb7278 100644
--- a/modules/filevercmp
+++ b/modules/filevercmp
@@ -6,10 +6,10 @@ lib/filevercmp.h
 lib/filevercmp.c
 
 Depends-on:
+assert-h
 c-ctype
 idx
 stdbool
-verify
 
 configure.ac:
 
diff --git a/modules/fma b/modules/fma
index dc45a94826..14e841842d 100644
--- a/modules/fma
+++ b/modules/fma
@@ -12,7 +12,7 @@ Depends-on:
 math
 float           [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 stdbool         [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
-verify          [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
+assert-h        [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 isfinite        [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 integer_length  [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 frexp           [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
diff --git a/modules/fmaf b/modules/fmaf
index 53fe229c10..8373d61bc5 100644
--- a/modules/fmaf
+++ b/modules/fmaf
@@ -14,7 +14,7 @@ math
 extensions
 float           [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 stdbool         [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
-verify          [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
+assert-h         [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 isfinite        [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 integer_length  [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 frexpf          [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
diff --git a/modules/fmal b/modules/fmal
index e24ff02a95..3927262e6a 100644
--- a/modules/fmal
+++ b/modules/fmal
@@ -15,7 +15,7 @@ extensions
 fma             [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
 float           [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 stdbool         [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
-verify          [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+assert-h        [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 isfinite        [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 integer_length  [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 frexpl          [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
diff --git a/modules/fstat b/modules/fstat
index 508aa76a22..394f2fa4ed 100644
--- a/modules/fstat
+++ b/modules/fstat
@@ -14,7 +14,7 @@ pathmax         [test $REPLACE_FSTAT = 1]
 stat            [test $REPLACE_FSTAT = 1]
 stat-time       [test $REPLACE_FSTAT = 1]
 unistd          [test $REPLACE_FSTAT = 1]
-verify          [test $REPLACE_FSTAT = 1]
+assert-h        [test $REPLACE_FSTAT = 1]
 msvc-nothrow    [test $REPLACE_FSTAT = 1]
 
 configure.ac:
diff --git a/modules/i-ring b/modules/i-ring
index 374970694b..1d23a9fe51 100644
--- a/modules/i-ring
+++ b/modules/i-ring
@@ -7,8 +7,8 @@ lib/i-ring.c
 m4/i-ring.m4
 
 Depends-on:
+assert-h
 stdbool
-verify
 
 configure.ac:
 gl_I_RING
diff --git a/modules/ino-map b/modules/ino-map
index c340d1ef4c..8905b2ae9c 100644
--- a/modules/ino-map
+++ b/modules/ino-map
@@ -6,8 +6,8 @@ lib/ino-map.c
 lib/ino-map.h
 
 Depends-on:
+assert-h
 hash
-verify
 
 configure.ac:
 
diff --git a/modules/intprops-tests b/modules/intprops-tests
index f02b357584..1a230ccde8 100644
--- a/modules/intprops-tests
+++ b/modules/intprops-tests
@@ -3,9 +3,9 @@ tests/test-intprops.c
 tests/macros.h
 
 Depends-on:
+assert-h
 inttypes
 stdbool
-verify
 
 configure.ac:
 
diff --git a/modules/libgmp-tests b/modules/libgmp-tests
index a80c478c77..b0cb73d1f4 100644
--- a/modules/libgmp-tests
+++ b/modules/libgmp-tests
@@ -3,8 +3,8 @@ tests/macros.h
 tests/test-libgmp.c
 
 Depends-on:
+assert-h
 c99
-verify
 
 configure.ac:
 
diff --git a/modules/limits-h-tests b/modules/limits-h-tests
index 7a70e5782b..2cf0a41f5d 100644
--- a/modules/limits-h-tests
+++ b/modules/limits-h-tests
@@ -2,8 +2,8 @@ Files:
 tests/test-limits-h.c
 
 Depends-on:
+assert-h
 extensions
-verify
 limits-h-c++-tests
 
 configure.ac:
diff --git a/modules/locale-tests b/modules/locale-tests
index 2e661f7565..11b840da9a 100644
--- a/modules/locale-tests
+++ b/modules/locale-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-locale.c
 
 Depends-on:
-verify
+assert-h
 locale-c++-tests
 
 configure.ac:
diff --git a/modules/malloca b/modules/malloca
index 9c279c45f1..6e5fc8d566 100644
--- a/modules/malloca
+++ b/modules/malloca
@@ -9,10 +9,10 @@ m4/eealloc.m4
 
 Depends-on:
 alloca-opt
+assert-h
 idx
 stdckdint
 stdint
-verify
 xalloc-oversized
 
 configure.ac:
diff --git a/modules/mbrtoc32 b/modules/mbrtoc32
index 63ed5ebe1f..4757bcbe02 100644
--- a/modules/mbrtoc32
+++ b/modules/mbrtoc32
@@ -22,9 +22,9 @@ attribute       [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 c99             [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0]
 hard-locale     [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0]
 mbrtowc         [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0]
+assert-h        [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 localcharset    [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 streq           [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
-verify          [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 
 configure.ac:
 gl_FUNC_MBRTOC32
diff --git a/modules/mbrtowc b/modules/mbrtowc
index ed9ebd7152..e81da6f350 100644
--- a/modules/mbrtowc
+++ b/modules/mbrtowc
@@ -26,9 +26,9 @@ attribute       [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 stdint          [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 hard-locale     [{ test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; } && test $REPLACE_MBSTATE_T = 0]
 mbsinit         [{ test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; } && test $REPLACE_MBSTATE_T = 0]
+assert-h        [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 localcharset    [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 streq           [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
-verify          [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 
 configure.ac:
 gl_FUNC_MBRTOWC
diff --git a/modules/mbsinit b/modules/mbsinit
index c500620b40..1040068223 100644
--- a/modules/mbsinit
+++ b/modules/mbsinit
@@ -9,8 +9,8 @@ m4/mbstate_t.m4
 Depends-on:
 wchar
 extensions
+assert-h        [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
 mbrtowc         [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
-verify          [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
 
 configure.ac:
 gl_FUNC_MBSINIT
diff --git a/modules/mbsnrtoc32s b/modules/mbsnrtoc32s
index ac464a8950..24a8458f3f 100644
--- a/modules/mbsnrtoc32s
+++ b/modules/mbsnrtoc32s
@@ -9,7 +9,7 @@ lib/mbsrtoc32s-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 mbrtoc32
 minmax
 strnlen1
diff --git a/modules/mbsrtoc32s b/modules/mbsrtoc32s
index 64892cf2a7..f9d97d7548 100644
--- a/modules/mbsrtoc32s
+++ b/modules/mbsrtoc32s
@@ -9,7 +9,7 @@ lib/mbsrtoc32s-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 mbrtoc32
 strnlen1
 mbsrtowcs       [test $SMALL_WCHAR_T = 0]
diff --git a/modules/nanosleep b/modules/nanosleep
index a8d0c76744..d0855460cd 100644
--- a/modules/nanosleep
+++ b/modules/nanosleep
@@ -9,11 +9,11 @@ Depends-on:
 time
 extensions
 multiarch
+assert-h        [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 intprops        [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 pselect         [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 stdbool         [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 sys_select      [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
-verify          [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 
 configure.ac:
 gl_FUNC_NANOSLEEP
diff --git a/modules/parse-datetime b/modules/parse-datetime
index 8a2d050dee..72aa6af659 100644
--- a/modules/parse-datetime
+++ b/modules/parse-datetime
@@ -9,6 +9,7 @@ m4/tm_gmtoff.m4
 m4/parse-datetime.m4
 
 Depends-on:
+assert-h
 bison
 c99
 c-ctype
@@ -26,7 +27,6 @@ time
 time_r
 time_rz
 timegm
-verify
 
 configure.ac:
 gl_PARSE_DATETIME
diff --git a/modules/pipe2 b/modules/pipe2
index 08758ba77a..a933d626f0 100644
--- a/modules/pipe2
+++ b/modules/pipe2
@@ -10,7 +10,7 @@ unistd
 fcntl-h
 binary-io
 extensions
-verify
+assert-h
 
 configure.ac:
 gl_FUNC_PIPE2
diff --git a/modules/pthread-h-tests b/modules/pthread-h-tests
index 13fd05b3a0..962ff0e7ca 100644
--- a/modules/pthread-h-tests
+++ b/modules/pthread-h-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-pthread.c
 
 Depends-on:
-verify
+assert-h
 pthread-h-c++-tests
 
 configure.ac:
diff --git a/modules/rawmemchr b/modules/rawmemchr
index f3e46881d5..03da3a27b7 100644
--- a/modules/rawmemchr
+++ b/modules/rawmemchr
@@ -7,11 +7,11 @@ lib/rawmemchr.valgrind
 m4/rawmemchr.m4
 
 Depends-on:
+assert-h
 extensions
 stdalign
 stdint
 string
-verify
 
 configure.ac:
 gl_FUNC_RAWMEMCHR
diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper
index 9b9d9c3abe..a60aa24d67 100644
--- a/modules/relocatable-prog-wrapper
+++ b/modules/relocatable-prog-wrapper
@@ -51,6 +51,7 @@ m4/relocatable-lib.m4
 m4/setenv.m4
 
 Depends-on:
+assert-h
 c99
 double-slash-root
 eloop-threshold
@@ -73,7 +74,6 @@ stdlib
 string
 sys_stat
 unistd
-verify
 xalloc-oversized
 
 configure.ac-early:
diff --git a/modules/round-tests b/modules/round-tests
index 2c4b37bf6e..6a0de71cf7 100644
--- a/modules/round-tests
+++ b/modules/round-tests
@@ -8,10 +8,10 @@ tests/signature.h
 tests/macros.h
 
 Depends-on:
+assert-h
 isnand-nolibm
 stdbool
 stdint
-verify
 
 configure.ac:
 
diff --git a/modules/roundf-tests b/modules/roundf-tests
index cd8af30202..29f06e45c2 100644
--- a/modules/roundf-tests
+++ b/modules/roundf-tests
@@ -9,12 +9,12 @@ tests/signature.h
 tests/macros.h
 
 Depends-on:
+assert-h
 ceilf
 floorf
 isnanf-nolibm
 stdbool
 stdint
-verify
 
 configure.ac:
 
diff --git a/modules/sleep b/modules/sleep
index 8ce74a43d9..fb81ebd683 100644
--- a/modules/sleep
+++ b/modules/sleep
@@ -7,8 +7,8 @@ m4/sleep.m4
 
 Depends-on:
 unistd
+assert-h        [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
 stdint          [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
-verify          [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
 
 configure.ac:
 gl_FUNC_SLEEP
diff --git a/modules/stat b/modules/stat
index 96d7a03fd5..0d01ab6055 100644
--- a/modules/stat
+++ b/modules/stat
@@ -10,12 +10,12 @@ m4/stat.m4
 Depends-on:
 sys_stat
 largefile
+assert-h        [test $REPLACE_STAT = 1]
 filename        [test $REPLACE_STAT = 1]
 malloca         [test $REPLACE_STAT = 1]
 pathmax         [test $REPLACE_STAT = 1]
 stat-time       [test $REPLACE_STAT = 1]
 stdbool         [test $REPLACE_STAT = 1]
-verify          [test $REPLACE_STAT = 1]
 
 configure.ac:
 gl_FUNC_STAT
diff --git a/modules/stdalign-tests b/modules/stdalign-tests
index 138fe3550e..e4665ed5fc 100644
--- a/modules/stdalign-tests
+++ b/modules/stdalign-tests
@@ -3,7 +3,7 @@ tests/test-stdalign.c
 tests/macros.h
 
 Depends-on:
-verify
+assert-h
 stdint
 stdalign-c++-tests
 
diff --git a/modules/stdckdint-tests b/modules/stdckdint-tests
index fb809dac3e..a4115ca44b 100644
--- a/modules/stdckdint-tests
+++ b/modules/stdckdint-tests
@@ -4,9 +4,9 @@ tests/test-intprops.c
 tests/test-stdckdint.c
 
 Depends-on:
+assert-h
 inttypes
 stdbool
-verify
 stdckdint-c++-tests
 
 configure.ac:
diff --git a/modules/stddef-tests b/modules/stddef-tests
index bb71e110b7..644eb0d7aa 100644
--- a/modules/stddef-tests
+++ b/modules/stddef-tests
@@ -2,8 +2,8 @@ Files:
 tests/test-stddef.c
 
 Depends-on:
+assert-h
 stdalign
-verify
 stddef-c++-tests
 
 configure.ac:
diff --git a/modules/stdio-tests b/modules/stdio-tests
index fcda690b7a..5368a2c64c 100644
--- a/modules/stdio-tests
+++ b/modules/stdio-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-stdio.c
 
 Depends-on:
-verify
+assert-h
 stdio-c++-tests
 fgetc-tests
 fputc-tests
diff --git a/modules/stdlib-tests b/modules/stdlib-tests
index 7225c65b8b..f7184bb4e1 100644
--- a/modules/stdlib-tests
+++ b/modules/stdlib-tests
@@ -3,7 +3,7 @@ tests/test-stdlib.c
 tests/test-sys_wait.h
 
 Depends-on:
-verify
+assert-h
 stdlib-c++-tests
 
 configure.ac:
diff --git a/modules/strerror b/modules/strerror
index 6ed290e929..acd17dee0a 100644
--- a/modules/strerror
+++ b/modules/strerror
@@ -7,10 +7,10 @@ m4/strerror.m4
 
 Depends-on:
 string
+assert-h         [test $REPLACE_STRERROR = 1]
 errno            [test $REPLACE_STRERROR = 1]
 intprops         [test $REPLACE_STRERROR = 1]
 strerror-override [test $REPLACE_STRERROR = 1]
-verify           [test $REPLACE_STRERROR = 1]
 
 configure.ac:
 gl_FUNC_STRERROR
diff --git a/modules/string-tests b/modules/string-tests
index ec732da6a3..b469c2e048 100644
--- a/modules/string-tests
+++ b/modules/string-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-string.c
 
 Depends-on:
-verify
+assert-h
 string-c++-tests
 
 configure.ac:
diff --git a/modules/strtoimax b/modules/strtoimax
index 80aa1dde65..942fb55a18 100644
--- a/modules/strtoimax
+++ b/modules/strtoimax
@@ -7,7 +7,7 @@ m4/strtoimax.m4
 
 Depends-on:
 inttypes-incomplete
-verify          [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
+assert-h        [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
 stdint          [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
 strtoll         [{ test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes]
 
diff --git a/modules/strtoumax b/modules/strtoumax
index 3d6bbf7281..5dfdd65ea2 100644
--- a/modules/strtoumax
+++ b/modules/strtoumax
@@ -8,7 +8,7 @@ m4/strtoumax.m4
 
 Depends-on:
 inttypes-incomplete
-verify          [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
+assert-h        [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
 stdint          [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
 strtoull        [{ test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; } && test $ac_cv_type_unsigned_long_long_int = yes]
 
diff --git a/modules/sys_stat-tests b/modules/sys_stat-tests
index a5ede77aba..7d4091bd75 100644
--- a/modules/sys_stat-tests
+++ b/modules/sys_stat-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-sys_stat.c
 
 Depends-on:
-verify
+assert-h
 sys_stat-c++-tests
 
 configure.ac:
diff --git a/modules/time-tests b/modules/time-tests
index de7e2383c8..e367565ece 100644
--- a/modules/time-tests
+++ b/modules/time-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-time.c
 
 Depends-on:
-verify
+assert-h
 time-c++-tests
 
 configure.ac:
diff --git a/modules/uchar-tests b/modules/uchar-tests
index 2dab71805b..5df13a09a4 100644
--- a/modules/uchar-tests
+++ b/modules/uchar-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-uchar.c
 
 Depends-on:
-verify
+assert-h
 uchar-c++-tests
 
 configure.ac:
diff --git a/modules/unistd-tests b/modules/unistd-tests
index 9b8222c604..e9ce6e0a3d 100644
--- a/modules/unistd-tests
+++ b/modules/unistd-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-unistd.c
 
 Depends-on:
-verify
+assert-h
 unistd-c++-tests
 
 configure.ac:
diff --git a/modules/unistdio/u16-u16-vasnprintf b/modules/unistdio/u16-u16-vasnprintf
index 9c27ccc7f5..ac8df9f1b1 100644
--- a/modules/unistdio/u16-u16-vasnprintf
+++ b/modules/unistdio/u16-u16-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u16-vasnprintf b/modules/unistdio/u16-vasnprintf
index 285640b6ea..e767f54bd3 100644
--- a/modules/unistdio/u16-vasnprintf
+++ b/modules/unistdio/u16-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u32-u32-vasnprintf b/modules/unistdio/u32-u32-vasnprintf
index c4fe86d61d..86e669723b 100644
--- a/modules/unistdio/u32-u32-vasnprintf
+++ b/modules/unistdio/u32-u32-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u32-vasnprintf b/modules/unistdio/u32-vasnprintf
index a7582ff922..58185bc34b 100644
--- a/modules/unistdio/u32-vasnprintf
+++ b/modules/unistdio/u32-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u8-u8-vasnprintf b/modules/unistdio/u8-u8-vasnprintf
index a583f3442d..63ab8d8768 100644
--- a/modules/unistdio/u8-u8-vasnprintf
+++ b/modules/unistdio/u8-u8-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u8-vasnprintf b/modules/unistdio/u8-vasnprintf
index 3fdaa9ce38..f6be0a5de3 100644
--- a/modules/unistdio/u8-vasnprintf
+++ b/modules/unistdio/u8-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/ulc-vasnprintf b/modules/unistdio/ulc-vasnprintf
index 5691007019..61107fe13a 100644
--- a/modules/unistdio/ulc-vasnprintf
+++ b/modules/unistdio/ulc-vasnprintf
@@ -45,7 +45,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/utimecmp b/modules/utimecmp
index dffe861c2d..af6b8c2898 100644
--- a/modules/utimecmp
+++ b/modules/utimecmp
@@ -16,7 +16,7 @@ utimensat
 intprops
 stdbool
 stdint
-verify
+assert-h
 
 configure.ac:
 gl_UTIMECMP
diff --git a/modules/vasnprintf b/modules/vasnprintf
index bcde2b9cfd..7d40973cdb 100644
--- a/modules/vasnprintf
+++ b/modules/vasnprintf
@@ -30,7 +30,7 @@ stdint
 xsize
 errno
 memchr
-verify
+assert-h
 wchar
 
 configure.ac:
diff --git a/modules/wchar-tests b/modules/wchar-tests
index afe3bff752..3e6b6cf3f7 100644
--- a/modules/wchar-tests
+++ b/modules/wchar-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-wchar.c
 
 Depends-on:
-verify
+assert-h
 wchar-c++-tests
 
 configure.ac:
diff --git a/tests/test-alignof.c b/tests/test-alignof.c
index fd11789932..0e516f5d1b 100644
--- a/tests/test-alignof.c
+++ b/tests/test-alignof.c
@@ -23,8 +23,6 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include "verify.h"
-
 typedef long double longdouble;
 typedef struct { char a[1]; } struct1;
 typedef struct { char a[2]; } struct2;
@@ -33,7 +31,7 @@ typedef struct { char a[4]; } struct4;
 
 #define CHECK(type) \
   typedef struct { char slot1; type slot2; } type##_helper; \
-  verify (alignof_slot (type) == offsetof (type##_helper, slot2)); \
+  static_assert (alignof_slot (type) == offsetof (type##_helper, slot2)); \
   const int type##_slot_alignment = alignof_slot (type); \
   const int type##_type_alignment = alignof_type (type);
 
diff --git a/tests/test-intprops.c b/tests/test-intprops.c
index 84265ea3f2..a54d581229 100644
--- a/tests/test-intprops.c
+++ b/tests/test-intprops.c
@@ -35,7 +35,6 @@
 #else
 # include "intprops.h"
 #endif
-#include "verify.h"
 
 #include <inttypes.h>
 #include <limits.h>
@@ -44,7 +43,7 @@
 
 /* Compile-time verification of expression X.
    In this file, we need it as a statement, rather than as a declaration.  */
-#define verify_stmt(x) do { verify (x); } while (0)
+#define verify_stmt(x) do { static_assert (x); } while (0)
 
 /* VERIFY (X) uses a static assertion for compilers that are known to work,
    and falls back on a dynamic assertion for other compilers.
diff --git a/tests/test-libgmp.c b/tests/test-libgmp.c
index fcb77d3885..ec1766affd 100644
--- a/tests/test-libgmp.c
+++ b/tests/test-libgmp.c
@@ -22,14 +22,12 @@
 #include <limits.h>
 #include <string.h>
 
-#include "verify.h"
-
 #include "macros.h"
 
 #ifndef MINI_GMP_LIMB_TYPE
 /* Verify that the gmp.h header file was generated for the same
    machine word size as we are using.  */
-verify (GMP_NUMB_BITS == sizeof (mp_limb_t) * CHAR_BIT);
+static_assert (GMP_NUMB_BITS == sizeof (mp_limb_t) * CHAR_BIT);
 #endif
 
 int
diff --git a/tests/test-limits-h.c b/tests/test-limits-h.c
index 5da02f0575..ddcb5d5648 100644
--- a/tests/test-limits-h.c
+++ b/tests/test-limits-h.c
@@ -20,14 +20,12 @@
 
 #include <limits.h>
 
-#include "verify.h"
-
 #if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
 # pragma GCC diagnostic ignored "-Woverlength-strings"
 #endif
 
 #define verify_width(width, min, max) \
-  verify ((max) >> ((width) - 1 - ((min) < 0)) == 1)
+  static_assert ((max) >> ((width) - 1 - ((min) < 0)) == 1)
 
 /* Macros borrowed from intprops.h.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
@@ -53,48 +51,48 @@ verify_width (LONG_BIT, LONG_MIN, LONG_MAX);
 /* Numerical limit macros.  */
 
 char               limits1[]  = { CHAR_MIN, CHAR_MAX };
-verify (TYPE_MINIMUM (char) == CHAR_MIN);
-verify (TYPE_MAXIMUM (char) == CHAR_MAX);
+static_assert (TYPE_MINIMUM (char) == CHAR_MIN);
+static_assert (TYPE_MAXIMUM (char) == CHAR_MAX);
 
 signed char        limits2[]  = { SCHAR_MIN, SCHAR_MAX };
-verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
-verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
+static_assert (TYPE_MINIMUM (signed char) == SCHAR_MIN);
+static_assert (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
 
 unsigned char      limits3[]  = { UCHAR_MAX };
-verify (TYPE_MINIMUM (unsigned char) == 0);
-verify (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
+static_assert (TYPE_MINIMUM (unsigned char) == 0);
+static_assert (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
 
 short              limits4[]  = { SHRT_MIN, SHRT_MAX };
-verify (TYPE_MINIMUM (short int) == SHRT_MIN);
-verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
+static_assert (TYPE_MINIMUM (short int) == SHRT_MIN);
+static_assert (TYPE_MAXIMUM (short int) == SHRT_MAX);
 
 unsigned short     limits5[]  = { USHRT_MAX };
-verify (TYPE_MINIMUM (unsigned short int) == 0);
-verify (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
+static_assert (TYPE_MINIMUM (unsigned short int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
 
 int                limits6[]  = { INT_MIN, INT_MAX };
-verify (TYPE_MINIMUM (int) == INT_MIN);
-verify (TYPE_MAXIMUM (int) == INT_MAX);
+static_assert (TYPE_MINIMUM (int) == INT_MIN);
+static_assert (TYPE_MAXIMUM (int) == INT_MAX);
 
 unsigned int       limits7[]  = { UINT_MAX };
-verify (TYPE_MINIMUM (unsigned int) == 0);
-verify (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
+static_assert (TYPE_MINIMUM (unsigned int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
 
 long               limits8[]  = { LONG_MIN, LONG_MAX };
-verify (TYPE_MINIMUM (long int) == LONG_MIN);
-verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+static_assert (TYPE_MINIMUM (long int) == LONG_MIN);
+static_assert (TYPE_MAXIMUM (long int) == LONG_MAX);
 
 unsigned long      limits9[]  = { ULONG_MAX };
-verify (TYPE_MINIMUM (unsigned long int) == 0);
-verify (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
+static_assert (TYPE_MINIMUM (unsigned long int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
 
 long long          limits10[] = { LLONG_MIN, LLONG_MAX };
-verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
-verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+static_assert (TYPE_MINIMUM (long long int) == LLONG_MIN);
+static_assert (TYPE_MAXIMUM (long long int) == LLONG_MAX);
 
 unsigned long long limits11[] = { ULLONG_MAX };
-verify (TYPE_MINIMUM (unsigned long long int) == 0);
-verify (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
+static_assert (TYPE_MINIMUM (unsigned long long int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
 
 /* Macros specified by ISO/IEC TS 18661-1:2014.  */
 
@@ -113,7 +111,7 @@ verify_width (ULLONG_WIDTH, 0, ULLONG_MAX);
 /* Macros specified by C2x.  */
 
 int bool_attrs[] = { BOOL_MAX, BOOL_WIDTH };
-verify (BOOL_MAX == (((1U << (BOOL_WIDTH - 1)) - 1) * 2) + 1);
+static_assert (BOOL_MAX == (((1U << (BOOL_WIDTH - 1)) - 1) * 2) + 1);
 
 int
 main (void)
diff --git a/tests/test-locale.c b/tests/test-locale.c
index 5c2bac1009..3aad7d85a8 100644
--- a/tests/test-locale.c
+++ b/tests/test-locale.c
@@ -20,8 +20,6 @@
 
 #include <locale.h>
 
-#include "verify.h"
-
 int a[] =
   {
     LC_ALL,
@@ -39,7 +37,7 @@ int ls;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 int
 main ()
diff --git a/tests/test-pthread.c b/tests/test-pthread.c
index 86131d867a..2fef5924e8 100644
--- a/tests/test-pthread.c
+++ b/tests/test-pthread.c
@@ -20,8 +20,6 @@
 
 #include <pthread.h>
 
-#include "verify.h"
-
 /* Check that the types are all defined.  */
 
 pthread_t t1;
diff --git a/tests/test-round2.c b/tests/test-round2.c
index 4cc37c59bf..05600eab7c 100644
--- a/tests/test-round2.c
+++ b/tests/test-round2.c
@@ -34,8 +34,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "verify.h"
-
 #ifdef USE_LONG_DOUBLE
 # error Long double not supported.
 #elif ! defined USE_FLOAT
@@ -99,7 +97,7 @@ main (void)
         /* Combine highbits and lowbits into a floating-point number,
            sign-extending the lowbits to DOUBLE_BITS-NUM_HIGHBITS bits.  */
         union { DOUBLE f; DOUBLE_UINT i; } janus;
-        verify (sizeof janus.f == sizeof janus.i);
+        static_assert (sizeof janus.f == sizeof janus.i);
         janus.i = lowbits | (highbits << (DOUBLE_BITS - NUM_HIGHBITS));
         if (lowbits >> (NUM_LOWBITS - 1))
           janus.i |= ((DOUBLE_UINT) -1
diff --git a/tests/test-stdalign.c b/tests/test-stdalign.c
index 85d23a6eda..b3473ea4c5 100644
--- a/tests/test-stdalign.c
+++ b/tests/test-stdalign.c
@@ -23,8 +23,6 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include "verify.h"
-
 #include "macros.h"
 
 typedef long double longdouble;
@@ -33,13 +31,13 @@ typedef struct { char a[2]; } struct2;
 typedef struct { char a[3]; } struct3;
 typedef struct { char a[4]; } struct4;
 
-verify (__alignof_is_defined == 1);
+static_assert (__alignof_is_defined == 1);
 #ifndef alignof
 # error "alignof is not a macro"
 #endif
 
 #if __alignas_is_defined
-verify (__alignas_is_defined == 1);
+static_assert (__alignas_is_defined == 1);
 # ifndef alignas
 #  error "alignas is not a macro"
 # endif
@@ -54,8 +52,8 @@ verify (__alignas_is_defined == 1);
 
 #define CHECK_STATIC(type) \
   typedef struct { char slot1; type slot2; } type##_helper; \
-  verify (alignof (type) == offsetof (type##_helper, slot2)); \
-  verify (_Alignof (type) == alignof (type)); \
+  static_assert (alignof (type) == offsetof (type##_helper, slot2)); \
+  static_assert (_Alignof (type) == alignof (type)); \
   const int type##_alignment = alignof (type); \
   type alignas (TEST_ALIGNMENT) static_##type##_alignas; \
   type _Alignas (TEST_ALIGNMENT) static_##type##_Alignas
diff --git a/tests/test-stddef.c b/tests/test-stddef.c
index 9983154e92..470c7a6bc1 100644
--- a/tests/test-stddef.c
+++ b/tests/test-stddef.c
@@ -21,7 +21,6 @@
 #include <stddef.h>
 #include <limits.h>
 #include <stdalign.h>
-#include "verify.h"
 
 /* Check that appropriate types are defined.  */
 wchar_t a = 'c';
@@ -31,7 +30,7 @@ max_align_t x;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that offsetof produces integer constants with correct type.  */
 struct d
@@ -42,32 +41,32 @@ struct d
 /* Solaris 10 has a bug where offsetof is under-parenthesized, and
    cannot be used as an arbitrary expression.  However, since it is
    unlikely to bite real code, we ignore that short-coming.  */
-/* verify (sizeof offsetof (struct d, e) == sizeof (size_t)); */
-verify (sizeof (offsetof (struct d, e)) == sizeof (size_t));
-verify (offsetof (struct d, f) == 1);
+/* static_assert (sizeof offsetof (struct d, e) == sizeof (size_t)); */
+static_assert (sizeof (offsetof (struct d, e)) == sizeof (size_t));
+static_assert (offsetof (struct d, f) == 1);
 
 /* offsetof promotes to an unsigned integer if and only if sizes do
    not fit in int.  */
-verify ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1));
+static_assert ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1));
 
 /* Check max_align_t's alignment.  */
-verify (alignof (double) <= alignof (max_align_t));
-verify (alignof (int) <= alignof (max_align_t));
-verify (alignof (long double) <= alignof (max_align_t));
-verify (alignof (long int) <= alignof (max_align_t));
-verify (alignof (ptrdiff_t) <= alignof (max_align_t));
-verify (alignof (size_t) <= alignof (max_align_t));
-verify (alignof (wchar_t) <= alignof (max_align_t));
-verify (alignof (struct d) <= alignof (max_align_t));
+static_assert (alignof (double) <= alignof (max_align_t));
+static_assert (alignof (int) <= alignof (max_align_t));
+static_assert (alignof (long double) <= alignof (max_align_t));
+static_assert (alignof (long int) <= alignof (max_align_t));
+static_assert (alignof (ptrdiff_t) <= alignof (max_align_t));
+static_assert (alignof (size_t) <= alignof (max_align_t));
+static_assert (alignof (wchar_t) <= alignof (max_align_t));
+static_assert (alignof (struct d) <= alignof (max_align_t));
 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
-verify (__alignof__ (double) <= __alignof__ (max_align_t));
-verify (__alignof__ (int) <= __alignof__ (max_align_t));
-verify (__alignof__ (long double) <= __alignof__ (max_align_t));
-verify (__alignof__ (long int) <= __alignof__ (max_align_t));
-verify (__alignof__ (ptrdiff_t) <= __alignof__ (max_align_t));
-verify (__alignof__ (size_t) <= __alignof__ (max_align_t));
-verify (__alignof__ (wchar_t) <= __alignof__ (max_align_t));
-verify (__alignof__ (struct d) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (double) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (int) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (long double) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (long int) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (ptrdiff_t) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (size_t) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (wchar_t) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (struct d) <= __alignof__ (max_align_t));
 #endif
 
 int
diff --git a/tests/test-stdio.c b/tests/test-stdio.c
index 695532ad95..1908da358a 100644
--- a/tests/test-stdio.c
+++ b/tests/test-stdio.c
@@ -20,14 +20,12 @@
 
 #include <stdio.h>
 
-#include "verify.h"
-
 /* Check that the various SEEK_* macros are defined.  */
 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that the types are all defined.  */
 fpos_t t1;
diff --git a/tests/test-stdlib.c b/tests/test-stdlib.c
index 4f1b965818..4fdafc9946 100644
--- a/tests/test-stdlib.c
+++ b/tests/test-stdlib.c
@@ -20,8 +20,6 @@
 
 #include <stdlib.h>
 
-#include "verify.h"
-
 /* Check that EXIT_SUCCESS is 0, per POSIX.  */
 static int exitcode = EXIT_SUCCESS;
 #if EXIT_SUCCESS
@@ -36,7 +34,7 @@ static int exitcode = EXIT_SUCCESS;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 #if GNULIB_TEST_SYSTEM_POSIX
 # include "test-sys_wait.h"
diff --git a/tests/test-string.c b/tests/test-string.c
index 9509a6a5d9..94688726dd 100644
--- a/tests/test-string.c
+++ b/tests/test-string.c
@@ -20,11 +20,9 @@
 
 #include <string.h>
 
-#include "verify.h"
-
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 int
 main (void)
diff --git a/tests/test-sys_stat.c b/tests/test-sys_stat.c
index 913b17e995..b404d9f22c 100644
--- a/tests/test-sys_stat.c
+++ b/tests/test-sys_stat.c
@@ -20,8 +20,6 @@
 
 #include <sys/stat.h>
 
-#include "verify.h"
-
 /* Check the existence of some macros.  */
 int a[] =
   {
@@ -61,264 +59,264 @@ int a[] =
 
 /* Sanity checks.  */
 
-verify (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR));
-verify (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP));
-verify (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH));
+static_assert (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR));
+static_assert (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP));
+static_assert (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH));
 
 #ifdef S_IFBLK
-verify (S_ISBLK (S_IFBLK));
+static_assert (S_ISBLK (S_IFBLK));
 #endif
-verify (!S_ISBLK (S_IFCHR));
-verify (!S_ISBLK (S_IFDIR));
-verify (!S_ISBLK (S_IFIFO));
-verify (!S_ISBLK (S_IFREG));
+static_assert (!S_ISBLK (S_IFCHR));
+static_assert (!S_ISBLK (S_IFDIR));
+static_assert (!S_ISBLK (S_IFIFO));
+static_assert (!S_ISBLK (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISBLK (S_IFLNK));
+static_assert (!S_ISBLK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISBLK (S_IFSOCK));
+static_assert (!S_ISBLK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISCHR (S_IFBLK));
+static_assert (!S_ISCHR (S_IFBLK));
 #endif
-verify (S_ISCHR (S_IFCHR));
-verify (!S_ISCHR (S_IFDIR));
-verify (!S_ISCHR (S_IFIFO));
-verify (!S_ISCHR (S_IFREG));
+static_assert (S_ISCHR (S_IFCHR));
+static_assert (!S_ISCHR (S_IFDIR));
+static_assert (!S_ISCHR (S_IFIFO));
+static_assert (!S_ISCHR (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISCHR (S_IFLNK));
+static_assert (!S_ISCHR (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISCHR (S_IFSOCK));
+static_assert (!S_ISCHR (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISDIR (S_IFBLK));
+static_assert (!S_ISDIR (S_IFBLK));
 #endif
-verify (!S_ISDIR (S_IFCHR));
-verify (S_ISDIR (S_IFDIR));
-verify (!S_ISDIR (S_IFIFO));
-verify (!S_ISDIR (S_IFREG));
+static_assert (!S_ISDIR (S_IFCHR));
+static_assert (S_ISDIR (S_IFDIR));
+static_assert (!S_ISDIR (S_IFIFO));
+static_assert (!S_ISDIR (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISDIR (S_IFLNK));
+static_assert (!S_ISDIR (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISDIR (S_IFSOCK));
+static_assert (!S_ISDIR (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISFIFO (S_IFBLK));
+static_assert (!S_ISFIFO (S_IFBLK));
 #endif
-verify (!S_ISFIFO (S_IFCHR));
-verify (!S_ISFIFO (S_IFDIR));
-verify (S_ISFIFO (S_IFIFO));
-verify (!S_ISFIFO (S_IFREG));
+static_assert (!S_ISFIFO (S_IFCHR));
+static_assert (!S_ISFIFO (S_IFDIR));
+static_assert (S_ISFIFO (S_IFIFO));
+static_assert (!S_ISFIFO (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISFIFO (S_IFLNK));
+static_assert (!S_ISFIFO (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISFIFO (S_IFSOCK));
+static_assert (!S_ISFIFO (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISREG (S_IFBLK));
+static_assert (!S_ISREG (S_IFBLK));
 #endif
-verify (!S_ISREG (S_IFCHR));
-verify (!S_ISREG (S_IFDIR));
-verify (!S_ISREG (S_IFIFO));
-verify (S_ISREG (S_IFREG));
+static_assert (!S_ISREG (S_IFCHR));
+static_assert (!S_ISREG (S_IFDIR));
+static_assert (!S_ISREG (S_IFIFO));
+static_assert (S_ISREG (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISREG (S_IFLNK));
+static_assert (!S_ISREG (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISREG (S_IFSOCK));
+static_assert (!S_ISREG (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISLNK (S_IFBLK));
+static_assert (!S_ISLNK (S_IFBLK));
 #endif
-verify (!S_ISLNK (S_IFCHR));
-verify (!S_ISLNK (S_IFDIR));
-verify (!S_ISLNK (S_IFIFO));
-verify (!S_ISLNK (S_IFREG));
+static_assert (!S_ISLNK (S_IFCHR));
+static_assert (!S_ISLNK (S_IFDIR));
+static_assert (!S_ISLNK (S_IFIFO));
+static_assert (!S_ISLNK (S_IFREG));
 #ifdef S_IFLNK
-verify (S_ISLNK (S_IFLNK));
+static_assert (S_ISLNK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISLNK (S_IFSOCK));
+static_assert (!S_ISLNK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISSOCK (S_IFBLK));
+static_assert (!S_ISSOCK (S_IFBLK));
 #endif
-verify (!S_ISSOCK (S_IFCHR));
-verify (!S_ISSOCK (S_IFDIR));
-verify (!S_ISSOCK (S_IFIFO));
-verify (!S_ISSOCK (S_IFREG));
+static_assert (!S_ISSOCK (S_IFCHR));
+static_assert (!S_ISSOCK (S_IFDIR));
+static_assert (!S_ISSOCK (S_IFIFO));
+static_assert (!S_ISSOCK (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISSOCK (S_IFLNK));
+static_assert (!S_ISSOCK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (S_ISSOCK (S_IFSOCK));
+static_assert (S_ISSOCK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISDOOR (S_IFBLK));
+static_assert (!S_ISDOOR (S_IFBLK));
 #endif
-verify (!S_ISDOOR (S_IFCHR));
-verify (!S_ISDOOR (S_IFDIR));
-verify (!S_ISDOOR (S_IFIFO));
-verify (!S_ISDOOR (S_IFREG));
+static_assert (!S_ISDOOR (S_IFCHR));
+static_assert (!S_ISDOOR (S_IFDIR));
+static_assert (!S_ISDOOR (S_IFIFO));
+static_assert (!S_ISDOOR (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISDOOR (S_IFLNK));
+static_assert (!S_ISDOOR (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISDOOR (S_IFSOCK));
+static_assert (!S_ISDOOR (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISMPB (S_IFBLK));
+static_assert (!S_ISMPB (S_IFBLK));
 #endif
-verify (!S_ISMPB (S_IFCHR));
-verify (!S_ISMPB (S_IFDIR));
-verify (!S_ISMPB (S_IFIFO));
-verify (!S_ISMPB (S_IFREG));
+static_assert (!S_ISMPB (S_IFCHR));
+static_assert (!S_ISMPB (S_IFDIR));
+static_assert (!S_ISMPB (S_IFIFO));
+static_assert (!S_ISMPB (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISMPB (S_IFLNK));
+static_assert (!S_ISMPB (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISMPB (S_IFSOCK));
+static_assert (!S_ISMPB (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISMPX (S_IFBLK));
+static_assert (!S_ISMPX (S_IFBLK));
 #endif
-verify (!S_ISMPX (S_IFCHR));
-verify (!S_ISMPX (S_IFDIR));
-verify (!S_ISMPX (S_IFIFO));
-verify (!S_ISMPX (S_IFREG));
+static_assert (!S_ISMPX (S_IFCHR));
+static_assert (!S_ISMPX (S_IFDIR));
+static_assert (!S_ISMPX (S_IFIFO));
+static_assert (!S_ISMPX (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISMPX (S_IFLNK));
+static_assert (!S_ISMPX (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISMPX (S_IFSOCK));
+static_assert (!S_ISMPX (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISNAM (S_IFBLK));
+static_assert (!S_ISNAM (S_IFBLK));
 #endif
-verify (!S_ISNAM (S_IFCHR));
-verify (!S_ISNAM (S_IFDIR));
-verify (!S_ISNAM (S_IFIFO));
-verify (!S_ISNAM (S_IFREG));
+static_assert (!S_ISNAM (S_IFCHR));
+static_assert (!S_ISNAM (S_IFDIR));
+static_assert (!S_ISNAM (S_IFIFO));
+static_assert (!S_ISNAM (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISNAM (S_IFLNK));
+static_assert (!S_ISNAM (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISNAM (S_IFSOCK));
+static_assert (!S_ISNAM (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISNWK (S_IFBLK));
+static_assert (!S_ISNWK (S_IFBLK));
 #endif
-verify (!S_ISNWK (S_IFCHR));
-verify (!S_ISNWK (S_IFDIR));
-verify (!S_ISNWK (S_IFIFO));
-verify (!S_ISNWK (S_IFREG));
+static_assert (!S_ISNWK (S_IFCHR));
+static_assert (!S_ISNWK (S_IFDIR));
+static_assert (!S_ISNWK (S_IFIFO));
+static_assert (!S_ISNWK (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISNWK (S_IFLNK));
+static_assert (!S_ISNWK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISNWK (S_IFSOCK));
+static_assert (!S_ISNWK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISPORT (S_IFBLK));
+static_assert (!S_ISPORT (S_IFBLK));
 #endif
-verify (!S_ISPORT (S_IFCHR));
-verify (!S_ISPORT (S_IFDIR));
-verify (!S_ISPORT (S_IFIFO));
-verify (!S_ISPORT (S_IFREG));
+static_assert (!S_ISPORT (S_IFCHR));
+static_assert (!S_ISPORT (S_IFDIR));
+static_assert (!S_ISPORT (S_IFIFO));
+static_assert (!S_ISPORT (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISPORT (S_IFLNK));
+static_assert (!S_ISPORT (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISPORT (S_IFSOCK));
+static_assert (!S_ISPORT (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISCTG (S_IFBLK));
+static_assert (!S_ISCTG (S_IFBLK));
 #endif
-verify (!S_ISCTG (S_IFCHR));
-verify (!S_ISCTG (S_IFDIR));
-verify (!S_ISCTG (S_IFIFO));
-verify (!S_ISCTG (S_IFREG));
+static_assert (!S_ISCTG (S_IFCHR));
+static_assert (!S_ISCTG (S_IFDIR));
+static_assert (!S_ISCTG (S_IFIFO));
+static_assert (!S_ISCTG (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISCTG (S_IFLNK));
+static_assert (!S_ISCTG (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISCTG (S_IFSOCK));
+static_assert (!S_ISCTG (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISOFD (S_IFBLK));
+static_assert (!S_ISOFD (S_IFBLK));
 #endif
-verify (!S_ISOFD (S_IFCHR));
-verify (!S_ISOFD (S_IFDIR));
-verify (!S_ISOFD (S_IFIFO));
-verify (!S_ISOFD (S_IFREG));
+static_assert (!S_ISOFD (S_IFCHR));
+static_assert (!S_ISOFD (S_IFDIR));
+static_assert (!S_ISOFD (S_IFIFO));
+static_assert (!S_ISOFD (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISOFD (S_IFLNK));
+static_assert (!S_ISOFD (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISOFD (S_IFSOCK));
+static_assert (!S_ISOFD (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISOFL (S_IFBLK));
+static_assert (!S_ISOFL (S_IFBLK));
 #endif
-verify (!S_ISOFL (S_IFCHR));
-verify (!S_ISOFL (S_IFDIR));
-verify (!S_ISOFL (S_IFIFO));
-verify (!S_ISOFL (S_IFREG));
+static_assert (!S_ISOFL (S_IFCHR));
+static_assert (!S_ISOFL (S_IFDIR));
+static_assert (!S_ISOFL (S_IFIFO));
+static_assert (!S_ISOFL (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISOFL (S_IFLNK));
+static_assert (!S_ISOFL (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISOFL (S_IFSOCK));
+static_assert (!S_ISOFL (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISWHT (S_IFBLK));
+static_assert (!S_ISWHT (S_IFBLK));
 #endif
-verify (!S_ISWHT (S_IFCHR));
-verify (!S_ISWHT (S_IFDIR));
-verify (!S_ISWHT (S_IFIFO));
-verify (!S_ISWHT (S_IFREG));
+static_assert (!S_ISWHT (S_IFCHR));
+static_assert (!S_ISWHT (S_IFDIR));
+static_assert (!S_ISWHT (S_IFIFO));
+static_assert (!S_ISWHT (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISWHT (S_IFLNK));
+static_assert (!S_ISWHT (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISWHT (S_IFSOCK));
+static_assert (!S_ISWHT (S_IFSOCK));
 #endif
 
 /* POSIX 2008 requires traditional encoding of permission constants.  */
-verify (S_IRWXU == 00700);
-verify (S_IRUSR == 00400);
-verify (S_IWUSR == 00200);
-verify (S_IXUSR == 00100);
-verify (S_IRWXG == 00070);
-verify (S_IRGRP == 00040);
-verify (S_IWGRP == 00020);
-verify (S_IXGRP == 00010);
-verify (S_IRWXO == 00007);
-verify (S_IROTH == 00004);
-verify (S_IWOTH == 00002);
-verify (S_IXOTH == 00001);
-verify (S_ISUID == 04000);
-verify (S_ISGID == 02000);
-verify (S_ISVTX == 01000);
+static_assert (S_IRWXU == 00700);
+static_assert (S_IRUSR == 00400);
+static_assert (S_IWUSR == 00200);
+static_assert (S_IXUSR == 00100);
+static_assert (S_IRWXG == 00070);
+static_assert (S_IRGRP == 00040);
+static_assert (S_IWGRP == 00020);
+static_assert (S_IXGRP == 00010);
+static_assert (S_IRWXO == 00007);
+static_assert (S_IROTH == 00004);
+static_assert (S_IWOTH == 00002);
+static_assert (S_IXOTH == 00001);
+static_assert (S_ISUID == 04000);
+static_assert (S_ISGID == 02000);
+static_assert (S_ISVTX == 01000);
 
 #if ((0 <= UTIME_NOW && UTIME_NOW < 1000000000)           \
      || (0 <= UTIME_OMIT && UTIME_OMIT < 1000000000)      \
diff --git a/tests/test-time.c b/tests/test-time.c
index 3c00a4ef04..6b69f3d529 100644
--- a/tests/test-time.c
+++ b/tests/test-time.c
@@ -20,8 +20,6 @@
 
 #include <time.h>
 
-#include "verify.h"
-
 /* Check that the types are all defined.  */
 struct timespec t1;
 #if 0
@@ -32,11 +30,11 @@ pid_t t2;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that TIME_UTC is defined and a positive integer.  */
 int t3 = TIME_UTC;
-verify (TIME_UTC > 0);
+static_assert (TIME_UTC > 0);
 
 int
 main (void)
diff --git a/tests/test-uchar.c b/tests/test-uchar.c
index a2af51c523..ad83d8ad91 100644
--- a/tests/test-uchar.c
+++ b/tests/test-uchar.c
@@ -20,8 +20,6 @@
 
 #include <uchar.h>
 
-#include "verify.h"
-
 /* Check that the types are defined.  */
 mbstate_t a = { 0 };
 size_t b = 5;
@@ -29,19 +27,19 @@ char16_t c = 'x';
 char32_t d = 'y';
 
 /* Check that char16_t and char32_t are unsigned types.  */
-verify ((char16_t)(-1) >= 0);
+static_assert ((char16_t)(-1) >= 0);
 #if !defined __HP_cc
-verify ((char32_t)(-1) >= 0);
+static_assert ((char32_t)(-1) >= 0);
 #endif
 
 /* Check that char32_t is at least 31 bits wide.  */
-verify ((char32_t)0x7FFFFFFF != (char32_t)0x3FFFFFFF);
+static_assert ((char32_t)0x7FFFFFFF != (char32_t)0x3FFFFFFF);
 
 /* Check that _GL_LARGE_CHAR32_T is correctly defined.  */
 #if _GL_LARGE_CHAR32_T
-verify (sizeof (char32_t) > sizeof (wchar_t));
+static_assert (sizeof (char32_t) > sizeof (wchar_t));
 #else
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 #endif
 
 int
diff --git a/tests/test-unistd.c b/tests/test-unistd.c
index 2c04b286ea..a59af1e3ff 100644
--- a/tests/test-unistd.c
+++ b/tests/test-unistd.c
@@ -20,11 +20,9 @@
 
 #include <unistd.h>
 
-#include "verify.h"
-
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that the various SEEK_* macros are defined.  */
 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
diff --git a/tests/test-wchar.c b/tests/test-wchar.c
index 97c3bfb3b3..af7c948601 100644
--- a/tests/test-wchar.c
+++ b/tests/test-wchar.c
@@ -20,15 +20,13 @@
 
 #include <wchar.h>
 
-#include "verify.h"
-
 /* Check that the types wchar_t and wint_t are defined.  */
 wchar_t a = 'c';
 wint_t b = 'x';
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 int
 main (void)
-- 
2.37.2



^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 0/2] static_assert and C23
  2022-09-13  3:32 [PROPOSED 0/2] static_assert and C23 Paul Eggert
  2022-09-13  3:32 ` [PROPOSED 1/2] assert-h: static_assert is a keyword in C23 Paul Eggert
  2022-09-13  3:32 ` [PROPOSED 2/2] assert-h: prefer to ‘verify’ Paul Eggert
@ 2022-09-13 22:50 ` Bruno Haible
  2022-09-13 23:06   ` Paul Eggert
  2 siblings, 1 reply; 13+ messages in thread
From: Bruno Haible @ 2022-09-13 22:50 UTC (permalink / raw)
  To: bug-gnulib, Paul Eggert

Paul Eggert wrote:
> I haven't installed these into Gnulib.  Comments welcome.

Looks all good to me (just from a quick review).

Bruno





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 0/2] static_assert and C23
  2022-09-13 22:50 ` [PROPOSED 0/2] static_assert and C23 Bruno Haible
@ 2022-09-13 23:06   ` Paul Eggert
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Eggert @ 2022-09-13 23:06 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 564 bytes --]

On 9/13/22 17:50, Bruno Haible wrote:
> Looks all good to me (just from a quick review).

Thanks for checking. I found a doc glitch and one minor code improvement 
and installed the first two attached patches which incorporate them.

I also did the same thing the alignas and alignof keywords, and 
installed the attached patches 0003 and 0004 for that.

The only other keyword upgraded in C23 is _Thread_local -> thread_local. 
I haven't looked into that; it's not needed for grep or  coreutils or 
tar which is what I've been testing this stuff on.

[-- Attachment #2: 0001-assert-h-static_assert-is-a-keyword-in-C23.patch --]
[-- Type: text/x-patch, Size: 10489 bytes --]

From c504bec035e90efceb212c538efc986ef3db7f7a Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 13 Sep 2022 17:29:35 -0500
Subject: [PATCH 1/4] assert-h: static_assert is a keyword in C23

* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
If not, arrange for config.h to #define static_assert
by including <assert.h>, and then do "#undef assert"
so that the assert macro still needs an explicit include.
This should be safe even on very old hosts, as assert.h
has been re-includable for decades.
* tests/tests-assert.c: New test.
* modules/assert-h-tests (Files, Makefile.am): Add it.
---
 ChangeLog                     | 11 ++++++
 doc/gnulib.texi               | 27 ++++++++++++-
 doc/posix-headers/assert.texi | 37 +++++++++++-------
 m4/assert_h.m4                | 47 +++++++++++++++++------
 modules/assert-h              |  2 +-
 modules/assert-h-tests        |  3 ++
 tests/test-assert.c           | 71 +++++++++++++++++++++++++++++++++++
 7 files changed, 171 insertions(+), 27 deletions(-)
 create mode 100644 tests/test-assert.c

diff --git a/ChangeLog b/ChangeLog
index 31fb6837f4..bba1a1a4e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,17 @@
 
 2022-09-13  Paul Eggert  <eggert@cs.ucla.edu>
 
+	assert-h: static_assert is a keyword in C23
+	* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
+	keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
+	If not, arrange for config.h to #define static_assert
+	by including <assert.h>, and then do "#undef assert"
+	so that the assert macro still needs an explicit include.
+	This should be safe even on very old hosts, as assert.h
+	has been re-includable for decades.
+	* tests/tests-assert.c: New test.
+	* modules/assert-h-tests (Files, Makefile.am): Add it.
+
 	stdalign-tests: port to C23
 	* tests/test-stdalign.c: Do not test __alignas_is_defined,
 	_Alignof, or _Alignas as they are obsolescent.
diff --git a/doc/gnulib.texi b/doc/gnulib.texi
index e9c2fd8fa6..1bef2a0975 100644
--- a/doc/gnulib.texi
+++ b/doc/gnulib.texi
@@ -865,7 +865,8 @@ This chapter describes which keywords specified by ISO C are
 substituted by Gnulib.
 
 @menu
-* bool::  @code{bool}, @code{false}, and @code{true}
+* bool::           @code{bool}, @code{false}, and @code{true}
+* static_assert::  @code{static_assert}
 @end menu
 
 @node bool
@@ -889,6 +890,30 @@ On pre-C23 platforms, the keyword substitutes are macros.
 On pre-C23 platforms, the keyword substitutes assume C99 or later.
 @end itemize
 
+@node static_assert
+@section @code{static_assert}
+
+Gnulib module: assert-h
+
+The @code{assert-h} module arranges for both @code{static_assert} and
+@code{<assert.h>} to be like standard C@.  @xref{assert.h}.
+
+Portability problems fixed by Gnulib:
+@itemize
+@item
+Pre-C11 platforms lack @code{static_assert}.
+
+@item
+On pre-C23 platforms, @code{<assert.h>} must be included before
+using @code{static_assert}.
+@end itemize
+
+Portability problems not fixed by Gnulib:
+@itemize
+@item
+On pre-C23 platforms, @code{static_assert} is a macro.
+@end itemize
+
 @node Header File Substitutes
 @chapter ISO C and POSIX Header File Substitutes
 
diff --git a/doc/posix-headers/assert.texi b/doc/posix-headers/assert.texi
index 3392a1691a..f3d50533f9 100644
--- a/doc/posix-headers/assert.texi
+++ b/doc/posix-headers/assert.texi
@@ -10,28 +10,37 @@ See also the Gnulib modules @code{assert} and @code{verify}.
 Portability problems fixed by Gnulib:
 @itemize
 @item
-On older platforms @code{static_assert} and @code{_Static_assert} do
-not allow the second string-literal argument to be omitted.  For
-example, GCC versions before 9.1 do not support the single-argument
-@code{static_assert} that was standardized by C2x and C++17.
+On older C platforms @code{<assert.h>} must be included before using
+@code{static_assert}.  For example, GCC versions before 13 do not
+support the @code{static_assert} keyword that was standardized by C23.
 @item
-Even-older platforms do not support @code{static_assert} or
-@code{_Static_assert} at all.  For example, GCC versions before 4.6 do
-not support @code{_Static_assert}, and G++ versions before 4.3 do not
-support @code{static_assert}, which was standardized by C11 and C++11.
+On older platforms @code{static_assert} does not allow the second
+string-literal argument to be omitted.  For example, GCC versions
+before 9.1 do not support the single-argument @code{static_assert}
+that was standardized by C23 and C++17.
+@item
+Even-older platforms do not support @code{static_assert} at all.
+For example, GCC versions before 4.6 and G++ versions before 4.3
+do not support the two-argument form, which was standardized
+by C11 and C++11.
+@item
+Older C platforms might not support the obsolescent
+@code{_Static_assert} keyword or macro.
+This portability problem should not matter with code using this
+module, as such code should use @code{static_assert} instead.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
 @item
-C @code{_Static_assert} and C++ @code{static_assert}
-are keywords that can be used without including @code{<assert.h>}.
-The Gnulib substitutes are macros that require including @code{<assert.h>}.
-@item
-The C @code{static_assert} and @code{_Static_assert} can also
+A @code{static_assert} can also
 be used within a @code{struct} or @code{union} specifier, in place of
 an ordinary declaration of a member of the struct or union.  The
-Gnulib substitute can be used only as an ordinary declaration.
+Gnulib substitute can be used only as an ordinary declaration
+in code intended to be portable to C99 or earlier.
+@item
+In C23 and C++11 and later, @code{static_assert} is a keyword.
+In C11 and C17 it is a macro.  Any Gnulib substitute is also a macro.
 @item
 In C99 and later, @code{assert} can be applied to any scalar expression.
 In C89, the argument to @code{assert} is of type @code{int}.
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
index 7af15a2287..36b3c78c91 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -8,22 +8,47 @@ dnl From Paul Eggert.
 
 AC_DEFUN([gl_ASSERT_H],
 [
-  GL_GENERATE_ASSERT_H=false
   AC_CACHE_CHECK([for static_assert], [gl_cv_static_assert],
-    [AC_COMPILE_IFELSE(
+    [gl_save_CFLAGS=$CFLAGS
+     for gl_working in "yes, a keyword" "yes, an <assert.h> macro"; do
+      AS_CASE([$gl_working],
+        [*assert.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_ASSERT_H"])
+
+      AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
-          [[#include <assert.h>
-            static_assert (2 + 2 == 4, "arithmetic doesn't work");
+          [[#ifdef INCLUDE_ASSERT_H
+             #include <assert.h>
+            #endif
+            static_assert (2 + 2 == 4, "arithmetic does not work");
             static_assert (2 + 2 == 4);
           ]],
           [[
-            static_assert (sizeof (char) == 1, "sizeof doesn't work");
+            static_assert (sizeof (char) == 1, "sizeof does not work");
             static_assert (sizeof (char) == 1);
           ]])],
-       [gl_cv_static_assert=yes],
-       [gl_cv_static_assert=no])])
-  if test $gl_cv_static_assert = no; then
-    GL_GENERATE_ASSERT_H=true
-    gl_NEXT_HEADERS([assert.h])
-  fi
+       [gl_cv_static_assert=$gl_working],
+       [gl_cv_static_assert=no])
+      CFLAGS=$gl_save_CFLAGS
+      test "$gl_cv_static_assert" != no && break
+     done])
+
+  GL_GENERATE_ASSERT_H=false
+  AS_CASE([$gl_cv_static_assert],
+    [yes*keyword*],
+      [AC_DEFINE([HAVE_C_STATIC_ASSERT], [1],
+         [Define to 1 if the static_assert keyword works.])],
+    [no],
+      [GL_GENERATE_ASSERT_H=true
+       gl_NEXT_HEADERS([assert.h])])
+
+  dnl The "zz" puts this toward config.h's end, to avoid potential
+  dnl collisions with other definitions.  #undef assert so that
+  dnl programs are not tempted to use it without specifically
+  dnl including assert.h.  Break the #undef apart with a comment
+  dnl so that 'configure' does not comment it out.
+  AH_VERBATIM([zzstatic_assert],
+[#if !defined HAVE_C_STATIC_ASSERT && __cpp_static_assert < 201411
+ #include <assert.h>
+ #undef/**/assert
+#endif])
 ])
diff --git a/modules/assert-h b/modules/assert-h
index bf7565dc21..b67d44fe4a 100644
--- a/modules/assert-h
+++ b/modules/assert-h
@@ -1,5 +1,5 @@
 Description:
-An <assert.h> that conforms to C11.
+An <assert.h> and static_assert that are like C23.
 
 Files:
 lib/assert.in.h
diff --git a/modules/assert-h-tests b/modules/assert-h-tests
index 19375f61c3..670b06947c 100644
--- a/modules/assert-h-tests
+++ b/modules/assert-h-tests
@@ -1,7 +1,10 @@
 Files:
+tests/test-assert.c
 
 Depends-on:
 
 configure.ac:
 
 Makefile.am:
+TESTS += test-assert
+check_PROGRAMS += test-assert
diff --git a/tests/test-assert.c b/tests/test-assert.c
new file mode 100644
index 0000000000..45b0c0f457
--- /dev/null
+++ b/tests/test-assert.c
@@ -0,0 +1,71 @@
+/* Test assert.h and static_assert.
+   Copyright 2022 Free Software Foundation, Inc.
+
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
+
+/* Written by Paul Eggert.  */
+
+#include <config.h>
+
+#define STATIC_ASSERT_TESTS \
+  static_assert (2 + 2 == 4, "arithmetic does not work"); \
+  static_assert (2 + 2 == 4); \
+  static_assert (sizeof (char) == 1, "sizeof does not work"); \
+  static_assert (sizeof (char) == 1)
+
+STATIC_ASSERT_TESTS;
+
+static char const *
+assert (char const *p, int i)
+{
+  return p + i;
+}
+
+static char const *
+f (char const *p)
+{
+  return assert (p, 0);
+}
+
+#include <assert.h>
+
+STATIC_ASSERT_TESTS;
+
+static int
+g (void)
+{
+  assert (f ("this should work"));
+  return 0;
+}
+
+#define NDEBUG 1
+#include <assert.h>
+
+STATIC_ASSERT_TESTS;
+
+static int
+h (void)
+{
+  assert (f ("this should work"));
+  return 0;
+}
+
+int
+main (void)
+{
+  STATIC_ASSERT_TESTS;
+  g ();
+  h ();
+  return 0;
+}
-- 
2.37.2


[-- Attachment #3: 0002-assert-h-prefer-to-verify.patch --]
[-- Type: text/x-patch, Size: 83940 bytes --]

From 28465e160f242e39e6008e6de674e7c2360cf7df Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 13 Sep 2022 17:29:36 -0500
Subject: [PATCH 2/4] =?UTF-8?q?assert-h:=20prefer=20to=20=E2=80=98verify?=
 =?UTF-8?q?=E2=80=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Where it’s easy, prefer ‘static_assert’ to ‘verify’,
as this simplifies the source by removing the need to
include verify.h.  Keep using ‘verify’ if verify.h
is used for other reasons, or if code is shared with glibc.
* lib/alignalloc.c, lib/argmatch.h, lib/c32is-impl.h:
* lib/c32snrtombs.c, lib/c32srtombs.c, lib/exclude.c:
* lib/filevercmp.c, lib/fma.c, lib/i-ring.h, lib/ino-map.c:
* lib/localeinfo.c, lib/malloca.c, lib/mbrtoc32.c, lib/mbrtowc.c:
* lib/mbsinit.c, lib/mbsnrtoc32s.c, lib/mbsrtoc32s.c:
* lib/nanosleep.c, lib/parse-datetime.y, lib/pipe2.c:
* lib/rawmemchr.c, lib/relocwrapper.c, lib/sleep.c:
* lib/stat-w32.c, lib/strerror.c, lib/strtoimax.c:
* lib/utimecmp.c, lib/vasnprintf.c, tests/test-alignof.c:
* tests/test-intprops.c, tests/test-libgmp.c:
* tests/test-limits-h.c, tests/test-locale.c:
* tests/test-pthread.c, tests/test-round2.c:
* tests/test-stdalign.c, tests/test-stddef.c, tests/test-stdio.c:
* tests/test-stdlib.c, tests/test-string.c, tests/test-sys_stat.c:
* tests/test-time.c, tests/test-uchar.c, tests/test-unistd.c:
* tests/test-wchar.c:
Prefer static_assert to verify, and stop including verify.h.
* lib/stat.c: Don’t include verify.h (this include was unnecessary).
* modules/alignalloc, modules/alignof-tests, modules/argmatch:
* modules/c-vasnprintf, modules/c32isalnum, modules/c32isalpha:
* modules/c32isblank, modules/c32iscntrl, modules/c32isdigit:
* modules/c32isgraph, modules/c32islower, modules/c32isprint:
* modules/c32ispunct, modules/c32isspace, modules/c32isupper:
* modules/c32isxdigit, modules/c32snrtombs, modules/c32srtombs:
* modules/exclude, modules/filevercmp, modules/fma, modules/fmaf:
* modules/fmal, modules/fstat, modules/i-ring, modules/ino-map:
* modules/intprops-tests, modules/libgmp-tests:
* modules/limits-h-tests, modules/locale-tests, modules/malloca:
* modules/mbrtoc32, modules/mbrtowc, modules/mbsinit:
* modules/mbsnrtoc32s, modules/mbsrtoc32s, modules/nanosleep:
* modules/parse-datetime, modules/pipe2, modules/pthread-h-tests:
* modules/rawmemchr, modules/relocatable-prog-wrapper:
* modules/round-tests, modules/roundf-tests, modules/sleep:
* modules/stat, modules/stdalign-tests, modules/stdckdint-tests:
* modules/stddef-tests, modules/stdio-tests, modules/stdlib-tests:
* modules/strerror, modules/string-tests, modules/strtoimax:
* modules/strtoumax, modules/sys_stat-tests, modules/time-tests:
* modules/uchar-tests, modules/unistd-tests:
* modules/unistdio/u16-u16-vasnprintf:
* modules/unistdio/u16-vasnprintf:
* modules/unistdio/u32-u32-vasnprintf:
* modules/unistdio/u32-vasnprintf:
* modules/unistdio/u8-u8-vasnprintf:
* modules/unistdio/u8-vasnprintf, modules/unistdio/ulc-vasnprintf:
* modules/utimecmp, modules/vasnprintf, modules/wchar-tests:
Depend on assert-h, not verify.
---
 ChangeLog                           |  52 ++++++
 lib/alignalloc.c                    |   5 +-
 lib/argmatch.h                      |   4 +-
 lib/c32is-impl.h                    |   3 +-
 lib/c32snrtombs.c                   |   4 +-
 lib/c32srtombs.c                    |   4 +-
 lib/exclude.c                       |   9 +-
 lib/filevercmp.c                    |   3 +-
 lib/fma.c                           |   5 +-
 lib/i-ring.h                        |   3 +-
 lib/ino-map.c                       |   3 +-
 lib/localeinfo.c                    |   8 +-
 lib/malloca.c                       |   3 +-
 lib/mbrtoc32.c                      |   3 +-
 lib/mbrtowc.c                       |   3 +-
 lib/mbsinit.c                       |   3 +-
 lib/mbsnrtoc32s.c                   |   4 +-
 lib/mbsrtoc32s.c                    |   4 +-
 lib/nanosleep.c                     |   3 +-
 lib/parse-datetime.y                |   9 +-
 lib/pipe2.c                         |   3 +-
 lib/rawmemchr.c                     |   3 +-
 lib/relocwrapper.c                  |   3 +-
 lib/sleep.c                         |   4 +-
 lib/stat-w32.c                      |   3 +-
 lib/stat.c                          |   1 -
 lib/strerror.c                      |   3 +-
 lib/strtoimax.c                     |   6 +-
 lib/utimecmp.c                      |   3 +-
 lib/vasnprintf.c                    |  11 +-
 modules/alignalloc                  |   2 +-
 modules/alignof-tests               |   3 +-
 modules/argmatch                    |   2 +-
 modules/c-vasnprintf                |   2 +-
 modules/c32isalnum                  |   2 +-
 modules/c32isalpha                  |   2 +-
 modules/c32isblank                  |   2 +-
 modules/c32iscntrl                  |   2 +-
 modules/c32isdigit                  |   2 +-
 modules/c32isgraph                  |   2 +-
 modules/c32islower                  |   2 +-
 modules/c32isprint                  |   2 +-
 modules/c32ispunct                  |   2 +-
 modules/c32isspace                  |   2 +-
 modules/c32isupper                  |   2 +-
 modules/c32isxdigit                 |   2 +-
 modules/c32snrtombs                 |   2 +-
 modules/c32srtombs                  |   2 +-
 modules/exclude                     |   2 +-
 modules/filevercmp                  |   2 +-
 modules/fma                         |   2 +-
 modules/fmaf                        |   2 +-
 modules/fmal                        |   2 +-
 modules/fstat                       |   2 +-
 modules/i-ring                      |   2 +-
 modules/ino-map                     |   2 +-
 modules/intprops-tests              |   2 +-
 modules/libgmp-tests                |   2 +-
 modules/limits-h-tests              |   2 +-
 modules/locale-tests                |   2 +-
 modules/malloca                     |   2 +-
 modules/mbrtoc32                    |   2 +-
 modules/mbrtowc                     |   2 +-
 modules/mbsinit                     |   2 +-
 modules/mbsnrtoc32s                 |   2 +-
 modules/mbsrtoc32s                  |   2 +-
 modules/nanosleep                   |   2 +-
 modules/parse-datetime              |   2 +-
 modules/pipe2                       |   2 +-
 modules/pthread-h-tests             |   2 +-
 modules/rawmemchr                   |   2 +-
 modules/relocatable-prog-wrapper    |   2 +-
 modules/round-tests                 |   2 +-
 modules/roundf-tests                |   2 +-
 modules/sleep                       |   2 +-
 modules/stat                        |   2 +-
 modules/stdalign-tests              |   2 +-
 modules/stdckdint-tests             |   2 +-
 modules/stddef-tests                |   2 +-
 modules/stdio-tests                 |   2 +-
 modules/stdlib-tests                |   2 +-
 modules/strerror                    |   2 +-
 modules/string-tests                |   2 +-
 modules/strtoimax                   |   2 +-
 modules/strtoumax                   |   2 +-
 modules/sys_stat-tests              |   2 +-
 modules/time-tests                  |   2 +-
 modules/uchar-tests                 |   2 +-
 modules/unistd-tests                |   2 +-
 modules/unistdio/u16-u16-vasnprintf |   2 +-
 modules/unistdio/u16-vasnprintf     |   2 +-
 modules/unistdio/u32-u32-vasnprintf |   2 +-
 modules/unistdio/u32-vasnprintf     |   2 +-
 modules/unistdio/u8-u8-vasnprintf   |   2 +-
 modules/unistdio/u8-vasnprintf      |   2 +-
 modules/unistdio/ulc-vasnprintf     |   2 +-
 modules/utimecmp                    |   2 +-
 modules/vasnprintf                  |   2 +-
 modules/wchar-tests                 |   2 +-
 tests/test-alignof.c                |   4 +-
 tests/test-intprops.c               |   3 +-
 tests/test-libgmp.c                 |   4 +-
 tests/test-limits-h.c               |  50 +++--
 tests/test-locale.c                 |   4 +-
 tests/test-pthread.c                |   2 -
 tests/test-round2.c                 |   4 +-
 tests/test-stdalign.c               |   4 +-
 tests/test-stddef.c                 |  43 +++--
 tests/test-stdio.c                  |   4 +-
 tests/test-stdlib.c                 |   4 +-
 tests/test-string.c                 |   4 +-
 tests/test-sys_stat.c               | 276 ++++++++++++++--------------
 tests/test-time.c                   |   6 +-
 tests/test-uchar.c                  |  12 +-
 tests/test-unistd.c                 |   4 +-
 tests/test-wchar.c                  |   4 +-
 116 files changed, 365 insertions(+), 381 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index bba1a1a4e4..7c1b0afadd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,58 @@
 
 2022-09-13  Paul Eggert  <eggert@cs.ucla.edu>
 
+	assert-h: prefer to ‘verify’
+	Where it’s easy, prefer ‘static_assert’ to ‘verify’,
+	as this simplifies the source by removing the need to
+	include verify.h.  Keep using ‘verify’ if verify.h
+	is used for other reasons, or if code is shared with glibc.
+	* lib/alignalloc.c, lib/argmatch.h, lib/c32is-impl.h:
+	* lib/c32snrtombs.c, lib/c32srtombs.c, lib/exclude.c:
+	* lib/filevercmp.c, lib/fma.c, lib/i-ring.h, lib/ino-map.c:
+	* lib/localeinfo.c, lib/malloca.c, lib/mbrtoc32.c, lib/mbrtowc.c:
+	* lib/mbsinit.c, lib/mbsnrtoc32s.c, lib/mbsrtoc32s.c:
+	* lib/nanosleep.c, lib/parse-datetime.y, lib/pipe2.c:
+	* lib/rawmemchr.c, lib/relocwrapper.c, lib/sleep.c:
+	* lib/stat-w32.c, lib/strerror.c, lib/strtoimax.c:
+	* lib/utimecmp.c, lib/vasnprintf.c, tests/test-alignof.c:
+	* tests/test-intprops.c, tests/test-libgmp.c:
+	* tests/test-limits-h.c, tests/test-locale.c:
+	* tests/test-pthread.c, tests/test-round2.c:
+	* tests/test-stdalign.c, tests/test-stddef.c, tests/test-stdio.c:
+	* tests/test-stdlib.c, tests/test-string.c, tests/test-sys_stat.c:
+	* tests/test-time.c, tests/test-uchar.c, tests/test-unistd.c:
+	* tests/test-wchar.c:
+	Prefer static_assert to verify, and stop including verify.h.
+	* lib/stat.c: Don’t include verify.h (this include was unnecessary).
+	* modules/alignalloc, modules/alignof-tests, modules/argmatch:
+	* modules/c-vasnprintf, modules/c32isalnum, modules/c32isalpha:
+	* modules/c32isblank, modules/c32iscntrl, modules/c32isdigit:
+	* modules/c32isgraph, modules/c32islower, modules/c32isprint:
+	* modules/c32ispunct, modules/c32isspace, modules/c32isupper:
+	* modules/c32isxdigit, modules/c32snrtombs, modules/c32srtombs:
+	* modules/exclude, modules/filevercmp, modules/fma, modules/fmaf:
+	* modules/fmal, modules/fstat, modules/i-ring, modules/ino-map:
+	* modules/intprops-tests, modules/libgmp-tests:
+	* modules/limits-h-tests, modules/locale-tests, modules/malloca:
+	* modules/mbrtoc32, modules/mbrtowc, modules/mbsinit:
+	* modules/mbsnrtoc32s, modules/mbsrtoc32s, modules/nanosleep:
+	* modules/parse-datetime, modules/pipe2, modules/pthread-h-tests:
+	* modules/rawmemchr, modules/relocatable-prog-wrapper:
+	* modules/round-tests, modules/roundf-tests, modules/sleep:
+	* modules/stat, modules/stdalign-tests, modules/stdckdint-tests:
+	* modules/stddef-tests, modules/stdio-tests, modules/stdlib-tests:
+	* modules/strerror, modules/string-tests, modules/strtoimax:
+	* modules/strtoumax, modules/sys_stat-tests, modules/time-tests:
+	* modules/uchar-tests, modules/unistd-tests:
+	* modules/unistdio/u16-u16-vasnprintf:
+	* modules/unistdio/u16-vasnprintf:
+	* modules/unistdio/u32-u32-vasnprintf:
+	* modules/unistdio/u32-vasnprintf:
+	* modules/unistdio/u8-u8-vasnprintf:
+	* modules/unistdio/u8-vasnprintf, modules/unistdio/ulc-vasnprintf:
+	* modules/utimecmp, modules/vasnprintf, modules/wchar-tests:
+	Depend on assert-h, not verify.
+
 	assert-h: static_assert is a keyword in C23
 	* m4/assert_h.m4 (gl_ASSERT_H): Also test for static_assert
 	keyword a la C23, and define HAVE_C_STATIC_ASSERT if so.
diff --git a/lib/alignalloc.c b/lib/alignalloc.c
index 1884394e3c..1be5d4d2ba 100644
--- a/lib/alignalloc.c
+++ b/lib/alignalloc.c
@@ -26,7 +26,6 @@
 #include <stdalign.h>
 #include <stdckdint.h>
 #include <stdint.h>
-#include "verify.h"
 
 #if !ALIGNALLOC_VIA_ALIGNED_ALLOC
 # if HAVE_POSIX_MEMALIGN
@@ -37,7 +36,7 @@
    sizeof (void *) is a power of two, which is true on all known platforms.
    This check is here rather than in alignalloc.h to save the compiler
    the trouble of checking it each time alignalloc.h is included.  */
-verify (! (sizeof (void *) & (sizeof (void *) - 1)));
+static_assert (! (sizeof (void *) & (sizeof (void *) - 1)));
 
 # else /* !HAVE_POSIX_MEMALIGN */
 
@@ -62,7 +61,7 @@ address_of_pointer_to_malloced (unsigned char *r)
      for a 0 byte at R - 1.  This approach assumes UCHAR_MAX is large
      enough so that there is room for P; although true on all
      plausible platforms, check the assumption to be safe.  */
-  verify (sizeof (void *) + alignof (void *) - 1 <= UCHAR_MAX);
+  static_assert (sizeof (void *) + alignof (void *) - 1 <= UCHAR_MAX);
 
   return align_down (r - 1 - sizeof (void *), alignof (void *));
 }
diff --git a/lib/argmatch.h b/lib/argmatch.h
index 846cff9066..db98187d7f 100644
--- a/lib/argmatch.h
+++ b/lib/argmatch.h
@@ -29,7 +29,6 @@
 
 # include "gettext.h"
 # include "quote.h"
-# include "verify.h"
 
 # ifdef  __cplusplus
 extern "C" {
@@ -41,7 +40,8 @@ extern "C" {
    (argument list ends with a NULL guard).  */
 
 # define ARGMATCH_VERIFY(Arglist, Vallist) \
-    verify (ARRAY_CARDINALITY (Arglist) == ARRAY_CARDINALITY (Vallist) + 1)
+    static_assert (ARRAY_CARDINALITY (Arglist) \
+                   == ARRAY_CARDINALITY (Vallist) + 1)
 
 /* Return the index of the element of ARGLIST (NULL terminated) that
    matches with ARG.  If VALLIST is not NULL, then use it to resolve
diff --git a/lib/c32is-impl.h b/lib/c32is-impl.h
index 6b910fafbf..ed3758c9e0 100644
--- a/lib/c32is-impl.h
+++ b/lib/c32is-impl.h
@@ -37,7 +37,6 @@
 #endif
 
 #include "unictype.h"
-#include "verify.h"
 
 int
 FUNC (wint_t wc)
@@ -96,7 +95,7 @@ FUNC (wint_t wc)
 
 #else /* macOS, FreeBSD, NetBSD, OpenBSD, HP-UX, Solaris, Minix, Android */
   /* char32_t and wchar_t are equivalent.  */
-  verify (sizeof (char32_t) == sizeof (wchar_t));
+  static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
   return WCHAR_FUNC (wc);
 #endif
diff --git a/lib/c32snrtombs.c b/lib/c32snrtombs.c
index 6bbc65dad0..4b3b40a8f6 100644
--- a/lib/c32snrtombs.c
+++ b/lib/c32snrtombs.c
@@ -42,9 +42,7 @@ extern mbstate_t _gl_c32srtombs_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 c32snrtombs (char *dest, const char32_t **srcp, size_t srclen, size_t len,
diff --git a/lib/c32srtombs.c b/lib/c32srtombs.c
index d7480659a1..6f08deb234 100644
--- a/lib/c32srtombs.c
+++ b/lib/c32srtombs.c
@@ -42,9 +42,7 @@ extern mbstate_t _gl_c32srtombs_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 c32srtombs (char *dest, const char32_t **srcp, size_t len, mbstate_t *ps)
diff --git a/lib/exclude.c b/lib/exclude.c
index a39df312f2..4b96dbfc3f 100644
--- a/lib/exclude.c
+++ b/lib/exclude.c
@@ -37,7 +37,6 @@
 #include "mbuiter.h"
 #include "fnmatch.h"
 #include "xalloc.h"
-#include "verify.h"
 #include "filename.h"
 
 #if GNULIB_EXCLUDE_SINGLE_THREAD
@@ -55,10 +54,10 @@
 # define FNM_LEADING_DIR 0
 #endif
 
-verify (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
-         & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
-            | FNM_CASEFOLD | FNM_EXTMATCH))
-        == 0);
+static_assert (((EXCLUDE_ANCHORED | EXCLUDE_INCLUDE | EXCLUDE_WILDCARDS)
+                & (FNM_PATHNAME | FNM_NOESCAPE | FNM_PERIOD | FNM_LEADING_DIR
+                   | FNM_CASEFOLD | FNM_EXTMATCH))
+               == 0);
 
 
 /* Exclusion patterns are grouped into a singly-linked list of
diff --git a/lib/filevercmp.c b/lib/filevercmp.c
index cb1b38d473..844505a6bf 100644
--- a/lib/filevercmp.c
+++ b/lib/filevercmp.c
@@ -23,7 +23,6 @@
 #include <c-ctype.h>
 #include <limits.h>
 #include <idx.h>
-#include <verify.h>
 
 /* Return the length of a prefix of S that corresponds to the suffix
    defined by this extended regular expression in the C locale:
@@ -74,7 +73,7 @@ order (char const *s, idx_t pos, idx_t len)
     return -2;
   else
     {
-      verify (UCHAR_MAX <= (INT_MAX - 1 - 2) / 2);
+      static_assert (UCHAR_MAX <= (INT_MAX - 1 - 2) / 2);
       return c + UCHAR_MAX + 1;
     }
 }
diff --git a/lib/fma.c b/lib/fma.c
index 25a41c485f..55f4fcdc98 100644
--- a/lib/fma.c
+++ b/lib/fma.c
@@ -32,7 +32,6 @@
 
 #include "float+.h"
 #include "integer_length.h"
-#include "verify.h"
 
 #ifdef USE_LONG_DOUBLE
 # define FUNC fmal
@@ -94,11 +93,11 @@
 
 typedef unsigned int mp_limb_t;
 #define GMP_LIMB_BITS 32
-verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
 
 typedef unsigned long long mp_twolimb_t;
 #define GMP_TWOLIMB_BITS 64
-verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
 
 /* Number of limbs needed for a single DOUBLE.  */
 #define NLIMBS1 ((MANT_BIT + GMP_LIMB_BITS - 1) / GMP_LIMB_BITS)
diff --git a/lib/i-ring.h b/lib/i-ring.h
index ec27d5a3f4..d4efb9726d 100644
--- a/lib/i-ring.h
+++ b/lib/i-ring.h
@@ -14,10 +14,9 @@
    You should have received a copy of the GNU Lesser General Public License
    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
 
-#include "verify.h"
 
 enum { I_RING_SIZE = 4 };
-verify (1 <= I_RING_SIZE);
+static_assert (1 <= I_RING_SIZE);
 
 /* When ir_empty is true, the ring is empty.
    Otherwise, ir_data[B..F] are defined, where B..F is the contiguous
diff --git a/lib/ino-map.c b/lib/ino-map.c
index d9c56a0fa4..9a97391b8a 100644
--- a/lib/ino-map.c
+++ b/lib/ino-map.c
@@ -21,7 +21,6 @@
 #include "ino-map.h"
 
 #include "hash.h"
-#include "verify.h"
 
 #include <limits.h>
 #include <stdlib.h>
@@ -151,7 +150,7 @@ ino_map_insert (struct ino_map *im, ino_t ino)
          overflow to zero, then it must equal INO_MAP_INSERT_FAILURE,
          which is the value that should be returned in that case.
          Verify that this works.  */
-      verify (INO_MAP_INSERT_FAILURE + 1 == 0);
+      static_assert (INO_MAP_INSERT_FAILURE + 1 == 0);
 
       /* Prepare to allocate a new probe next time; this one is in use.  */
       im->probe = NULL;
diff --git a/lib/localeinfo.c b/lib/localeinfo.c
index 0e74f4220f..34c020cdc6 100644
--- a/lib/localeinfo.c
+++ b/lib/localeinfo.c
@@ -23,8 +23,6 @@
 
 #include <localeinfo.h>
 
-#include <verify.h>
-
 #include <limits.h>
 #include <locale.h>
 #include <stdlib.h>
@@ -32,7 +30,7 @@
 #include <wctype.h>
 
 /* The sbclen implementation relies on this.  */
-verify (MB_LEN_MAX <= SCHAR_MAX);
+static_assert (MB_LEN_MAX <= SCHAR_MAX);
 
 /* Return true if the locale uses UTF-8.  */
 
@@ -123,8 +121,8 @@ static short const lonesome_lower[] =
 
 /* Verify that the worst case fits.  This is 1 for towupper, 1 for
    towlower, and 1 for each entry in LONESOME_LOWER.  */
-verify (1 + 1 + sizeof lonesome_lower / sizeof *lonesome_lower
-        <= CASE_FOLDED_BUFSIZE);
+static_assert (1 + 1 + sizeof lonesome_lower / sizeof *lonesome_lower
+               <= CASE_FOLDED_BUFSIZE);
 
 /* Find the characters equal to C after case-folding, other than C
    itself, and store them into FOLDED.  Return the number of characters
diff --git a/lib/malloca.c b/lib/malloca.c
index 183783a710..1e19978d90 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -24,7 +24,6 @@
 #include <stdckdint.h>
 
 #include "idx.h"
-#include "verify.h"
 
 /* The speed critical point in this file is freea() applied to an alloca()
    result: it must be fast, to match the speed of alloca().  The speed of
@@ -40,7 +39,7 @@
 /* Type for holding very small pointer differences.  */
 typedef unsigned char small_t;
 /* Verify that it is wide enough.  */
-verify (2 * sa_alignment_max - 1 <= (small_t) -1);
+static_assert (2 * sa_alignment_max - 1 <= (small_t) -1);
 
 void *
 mmalloca (size_t n)
diff --git a/lib/mbrtoc32.c b/lib/mbrtoc32.c
index 6d09fe6db4..8f8095295d 100644
--- a/lib/mbrtoc32.c
+++ b/lib/mbrtoc32.c
@@ -52,11 +52,10 @@
 
 # endif
 
-# include "verify.h"
 # include "lc-charset-dispatch.h"
 # include "mbtowc-lock.h"
 
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
 static char internal_state[4];
 
 size_t
diff --git a/lib/mbrtowc.c b/lib/mbrtowc.c
index 4b164edd40..be6fdc6478 100644
--- a/lib/mbrtowc.c
+++ b/lib/mbrtowc.c
@@ -51,11 +51,10 @@
 # endif
 
 # include "attribute.h"
-# include "verify.h"
 # include "lc-charset-dispatch.h"
 # include "mbtowc-lock.h"
 
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
 static char internal_state[4];
 
 size_t
diff --git a/lib/mbsinit.c b/lib/mbsinit.c
index 9621defc73..2324f15680 100644
--- a/lib/mbsinit.c
+++ b/lib/mbsinit.c
@@ -20,7 +20,6 @@
 /* Specification.  */
 #include <wchar.h>
 
-#include "verify.h"
 
 #if GNULIB_defined_mbstate_t
 
@@ -39,7 +38,7 @@
      - In wc -> mb direction, mbstate_t contains no information. In other
        words, it is always in the initial state.  */
 
-verify (sizeof (mbstate_t) >= 4);
+static_assert (sizeof (mbstate_t) >= 4);
 
 int
 mbsinit (const mbstate_t *ps)
diff --git a/lib/mbsnrtoc32s.c b/lib/mbsnrtoc32s.c
index 8d44d0e13f..391baee449 100644
--- a/lib/mbsnrtoc32s.c
+++ b/lib/mbsnrtoc32s.c
@@ -51,9 +51,7 @@ extern mbstate_t _gl_mbsrtoc32s_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 mbsnrtoc32s (char32_t *dest, const char **srcp, size_t srclen, size_t len,
diff --git a/lib/mbsrtoc32s.c b/lib/mbsrtoc32s.c
index 6001b0bbf3..1cd0dd0ad1 100644
--- a/lib/mbsrtoc32s.c
+++ b/lib/mbsrtoc32s.c
@@ -43,9 +43,7 @@ extern mbstate_t _gl_mbsrtoc32s_state;
 #else
 /* char32_t and wchar_t are equivalent.  */
 
-# include "verify.h"
-
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 
 size_t
 mbsrtoc32s (char32_t *dest, const char **srcp, size_t len, mbstate_t *ps)
diff --git a/lib/nanosleep.c b/lib/nanosleep.c
index 78e612d4b1..55d6fa650e 100644
--- a/lib/nanosleep.c
+++ b/lib/nanosleep.c
@@ -23,7 +23,6 @@
 #include <time.h>
 
 #include "intprops.h"
-#include "verify.h"
 
 #include <stdio.h>
 #include <sys/types.h>
@@ -58,7 +57,7 @@ nanosleep (const struct timespec *requested_delay,
 
   {
     /* Verify that time_t is large enough.  */
-    verify (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
+    static_assert (TYPE_MAXIMUM (time_t) / 24 / 24 / 60 / 60);
     const time_t limit = 24 * 24 * 60 * 60;
     time_t seconds = requested_delay->tv_sec;
     struct timespec intermediate;
diff --git a/lib/parse-datetime.y b/lib/parse-datetime.y
index 0903c2003e..066d414c29 100644
--- a/lib/parse-datetime.y
+++ b/lib/parse-datetime.y
@@ -38,7 +38,6 @@
 #include "idx.h"
 #include "intprops.h"
 #include "timespec.h"
-#include "verify.h"
 #include "strftime.h"
 
 /* There's no need to extend the stack, so there's no need to involve
@@ -94,9 +93,9 @@
 /* Verify that time_t is an integer as POSIX requires, and that every
    time_t value fits in intmax_t.  Please file a bug report if these
    assumptions are false on your platform.  */
-verify (TYPE_IS_INTEGER (time_t));
-verify (!TYPE_SIGNED (time_t) || INTMAX_MIN <= TYPE_MINIMUM (time_t));
-verify (TYPE_MAXIMUM (time_t) <= INTMAX_MAX);
+static_assert (TYPE_IS_INTEGER (time_t));
+static_assert (!TYPE_SIGNED (time_t) || INTMAX_MIN <= TYPE_MINIMUM (time_t));
+static_assert (TYPE_MAXIMUM (time_t) <= INTMAX_MAX);
 
 /* True if N is out of range for time_t.  */
 static bool
@@ -1253,7 +1252,7 @@ enum { TM_YEAR_BUFSIZE = INT_BUFSIZE_BOUND (int) + 1 };
 static char const *
 tm_year_str (int tm_year, char buf[TM_YEAR_BUFSIZE])
 {
-  verify (TM_YEAR_BASE % 100 == 0);
+  static_assert (TM_YEAR_BASE % 100 == 0);
   sprintf (buf, &"-%02d%02d"[-TM_YEAR_BASE <= tm_year],
            abs (tm_year / 100 + TM_YEAR_BASE / 100),
            abs (tm_year % 100));
diff --git a/lib/pipe2.c b/lib/pipe2.c
index 400aff001a..a3cbb7f261 100644
--- a/lib/pipe2.c
+++ b/lib/pipe2.c
@@ -23,7 +23,6 @@
 #include <fcntl.h>
 
 #include "binary-io.h"
-#include "verify.h"
 
 #if GNULIB_defined_O_NONBLOCK
 # include "nonblocking.h"
@@ -95,7 +94,7 @@ pipe2 (int fd[2], int flags)
     }
 # else
   {
-    verify (O_NONBLOCK == 0);
+    static_assert (O_NONBLOCK == 0);
   }
 # endif
 
diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c
index ea68c1bfc6..c789599db8 100644
--- a/lib/rawmemchr.c
+++ b/lib/rawmemchr.c
@@ -26,7 +26,6 @@
 # include <stdalign.h>
 # include <stdint.h>
 
-# include "verify.h"
 
 /* Find the first occurrence of C in S.  */
 void *
@@ -36,7 +35,7 @@ rawmemchr (const void *s, int c_in)
   typedef uintptr_t longword;
   /* If you change the "uintptr_t", you should change UINTPTR_WIDTH to match.
      This verifies that the type does not have padding bits.  */
-  verify (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
+  static_assert (UINTPTR_WIDTH == UCHAR_WIDTH * sizeof (longword));
 
   const unsigned char *char_ptr;
   unsigned char c = c_in;
diff --git a/lib/relocwrapper.c b/lib/relocwrapper.c
index 3ec8b2888b..9ef115300a 100644
--- a/lib/relocwrapper.c
+++ b/lib/relocwrapper.c
@@ -81,7 +81,6 @@
 #include "progname.h"
 #include "relocatable.h"
 #include "c-ctype.h"
-#include "verify.h"
 
 /* Use the system functions, not the gnulib overrides in this file.  */
 #undef fprintf
@@ -142,7 +141,7 @@ add_dotbin (const char *filename)
 /* List of directories that contain the libraries.  */
 static const char *libdirs[] = { LIBDIRS NULL };
 /* Verify that at least one directory is given.  */
-verify (sizeof (libdirs) / sizeof (libdirs[0]) > 1);
+static_assert (sizeof (libdirs) / sizeof (libdirs[0]) > 1);
 
 /* Relocate the list of directories that contain the libraries.  */
 static void
diff --git a/lib/sleep.c b/lib/sleep.c
index 7a6fb152a7..80431c1081 100644
--- a/lib/sleep.c
+++ b/lib/sleep.c
@@ -22,8 +22,6 @@
 
 #include <limits.h>
 
-#include "verify.h"
-
 #if defined _WIN32 && ! defined __CYGWIN__
 
 # define WIN32_LEAN_AND_MEAN  /* avoid including junk */
@@ -56,7 +54,7 @@ unsigned int
 rpl_sleep (unsigned int seconds)
 {
   /* This requires int larger than 16 bits.  */
-  verify (UINT_MAX / 24 / 24 / 60 / 60);
+  static_assert (UINT_MAX / 24 / 24 / 60 / 60);
   const unsigned int limit = 24 * 24 * 60 * 60;
   while (limit < seconds)
     {
diff --git a/lib/stat-w32.c b/lib/stat-w32.c
index c1a2923977..e61b75c6e9 100644
--- a/lib/stat-w32.c
+++ b/lib/stat-w32.c
@@ -50,7 +50,6 @@
 #include "stat-w32.h"
 
 #include "pathmax.h"
-#include "verify.h"
 
 /* Don't assume that UNICODE is not defined.  */
 #undef LoadLibrary
@@ -228,7 +227,7 @@ _gl_fstat_by_handle (HANDLE h, const char *path, struct stat *buf)
           if (GetFileInformationByHandleExFunc (h, FileIdInfo, &id, sizeof (id)))
             {
               buf->st_dev = id.VolumeSerialNumber;
-              verify (sizeof (ino_t) == sizeof (id.FileId));
+              static_assert (sizeof (ino_t) == sizeof (id.FileId));
               memcpy (&buf->st_ino, &id.FileId, sizeof (ino_t));
               goto ino_done;
             }
diff --git a/lib/stat.c b/lib/stat.c
index cdcc33165f..adb6123352 100644
--- a/lib/stat.c
+++ b/lib/stat.c
@@ -58,7 +58,6 @@ orig_stat (const char *filename, struct stat *buf)
 #include <string.h>
 #include "filename.h"
 #include "malloca.h"
-#include "verify.h"
 
 #ifdef WINDOWS_NATIVE
 # define WIN32_LEAN_AND_MEAN
diff --git a/lib/strerror.c b/lib/strerror.c
index 67c5216e21..1019fe9eb6 100644
--- a/lib/strerror.c
+++ b/lib/strerror.c
@@ -27,7 +27,6 @@
 
 #include "intprops.h"
 #include "strerror-override.h"
-#include "verify.h"
 
 /* Use the system functions, not the gnulib overrides in this file.  */
 #undef sprintf
@@ -55,7 +54,7 @@ strerror (int n)
   if (!msg || !*msg)
     {
       static char const fmt[] = "Unknown error %d";
-      verify (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
+      static_assert (sizeof buf >= sizeof (fmt) + INT_STRLEN_BOUND (n));
       sprintf (buf, fmt, n);
       errno = EINVAL;
       return buf;
diff --git a/lib/strtoimax.c b/lib/strtoimax.c
index cad12d0d9b..29d16d29ce 100644
--- a/lib/strtoimax.c
+++ b/lib/strtoimax.c
@@ -25,8 +25,6 @@
 
 #include <stdlib.h>
 
-#include "verify.h"
-
 #ifdef UNSIGNED
 # ifndef HAVE_DECL_STRTOULL
 "this configure-time declaration test was not run"
@@ -62,8 +60,8 @@ long long int strtoll (char const *, char **, int);
 Int
 Strtoimax (char const *ptr, char **endptr, int base)
 {
-  verify (sizeof (Int) == sizeof (Unsigned long int)
-          || sizeof (Int) == sizeof (Unsigned long long int));
+  static_assert (sizeof (Int) == sizeof (Unsigned long int)
+                 || sizeof (Int) == sizeof (Unsigned long long int));
 
   if (sizeof (Int) != sizeof (Unsigned long int))
     return Strtoll (ptr, endptr, base);
diff --git a/lib/utimecmp.c b/lib/utimecmp.c
index 7312ee0b88..ae7729d26b 100644
--- a/lib/utimecmp.c
+++ b/lib/utimecmp.c
@@ -33,7 +33,6 @@
 #include "hash.h"
 #include "intprops.h"
 #include "stat-time.h"
-#include "verify.h"
 
 #ifndef MAX
 # define MAX(a, b) ((a) > (b) ? (a) : (b))
@@ -146,7 +145,7 @@ utimecmpat (int dfd, char const *dst_name,
 
      time_t might be unsigned.  */
 
-  verify (TYPE_IS_INTEGER (time_t));
+  static_assert (TYPE_IS_INTEGER (time_t));
 
   /* Destination and source timestamps.  */
   time_t dst_s = dst_stat->st_mtime;
diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c
index 285c674b9c..01d18bf598 100644
--- a/lib/vasnprintf.c
+++ b/lib/vasnprintf.c
@@ -101,7 +101,6 @@
 #include "xsize.h"
 
 #include "attribute.h"
-#include "verify.h"
 
 #if (NEED_PRINTF_DOUBLE || NEED_PRINTF_LONG_DOUBLE) && !defined IN_LIBINTL
 # include <math.h>
@@ -408,11 +407,11 @@ is_infinite_or_zerol (long double x)
 
 typedef unsigned int mp_limb_t;
 # define GMP_LIMB_BITS 32
-verify (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
+static_assert (sizeof (mp_limb_t) * CHAR_BIT == GMP_LIMB_BITS);
 
 typedef unsigned long long mp_twolimb_t;
 # define GMP_TWOLIMB_BITS 64
-verify (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
+static_assert (sizeof (mp_twolimb_t) * CHAR_BIT == GMP_TWOLIMB_BITS);
 
 /* Representation of a bignum >= 0.  */
 typedef struct
@@ -2628,7 +2627,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   size_t characters;
 #  if !DCHAR_IS_TCHAR
                   /* This code assumes that TCHAR_T is 'char'.  */
-                  verify (sizeof (TCHAR_T) == 1);
+                  static_assert (sizeof (TCHAR_T) == 1);
                   TCHAR_T *tmpsrc;
                   DCHAR_T *tmpdst;
                   size_t tmpdst_len;
@@ -2894,7 +2893,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                   size_t characters;
 # if !DCHAR_IS_TCHAR
                   /* This code assumes that TCHAR_T is 'char'.  */
-                  verify (sizeof (TCHAR_T) == 1);
+                  static_assert (sizeof (TCHAR_T) == 1);
                   TCHAR_T tmpsrc[64]; /* Assume MB_CUR_MAX <= 64.  */
                   DCHAR_T *tmpdst;
                   size_t tmpdst_len;
@@ -5451,7 +5450,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp,
                         DCHAR_T *tmpdst;
                         size_t tmpdst_len;
                         /* This code assumes that TCHAR_T is 'char'.  */
-                        verify (sizeof (TCHAR_T) == 1);
+                        static_assert (sizeof (TCHAR_T) == 1);
 # if USE_SNPRINTF
                         tmpsrc = (TCHAR_T *) (result + length);
 # else
diff --git a/modules/alignalloc b/modules/alignalloc
index 42ca672bc2..0a34b4bcf4 100644
--- a/modules/alignalloc
+++ b/modules/alignalloc
@@ -7,6 +7,7 @@ lib/alignalloc.c
 m4/alignalloc.m4
 
 Depends-on:
+assert-h
 extensions
 extern-inline
 idx
@@ -14,7 +15,6 @@ posix_memalign
 stdalign
 stdckdint
 stdint
-verify
 
 configure.ac:
 gl_ALIGNALLOC
diff --git a/modules/alignof-tests b/modules/alignof-tests
index be4cb942be..598351790e 100644
--- a/modules/alignof-tests
+++ b/modules/alignof-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-alignof.c
 
 Depends-on:
-verify
+assert-h
 stdint
 
 configure.ac:
@@ -10,4 +10,3 @@ configure.ac:
 Makefile.am:
 TESTS += test-alignof
 check_PROGRAMS += test-alignof
-
diff --git a/modules/argmatch b/modules/argmatch
index 97d84fbb93..bd534f5056 100644
--- a/modules/argmatch
+++ b/modules/argmatch
@@ -6,6 +6,7 @@ lib/argmatch.h
 lib/argmatch.c
 
 Depends-on:
+assert-h
 c99
 error
 exitfail
@@ -16,7 +17,6 @@ quote
 quotearg
 stdbool
 stdlib
-verify
 
 configure.ac:
 
diff --git a/modules/c-vasnprintf b/modules/c-vasnprintf
index f193f70856..44259c1f0e 100644
--- a/modules/c-vasnprintf
+++ b/modules/c-vasnprintf
@@ -22,6 +22,7 @@ m4/math_h.m4
 m4/exponentd.m4
 
 Depends-on:
+assert-h
 attribute
 stdio
 isnand-nolibm
@@ -39,7 +40,6 @@ xsize
 errno
 memchr
 multiarch
-verify
 
 configure.ac:
 AC_REQUIRE([AC_C_RESTRICT])
diff --git a/modules/c32isalnum b/modules/c32isalnum
index b03ba7fbc3..a6e42fefd4 100644
--- a/modules/c32isalnum
+++ b/modules/c32isalnum
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-alnum
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isalpha b/modules/c32isalpha
index d39e869471..8081cc2671 100644
--- a/modules/c32isalpha
+++ b/modules/c32isalpha
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-alpha
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isblank b/modules/c32isblank
index 948ae36212..1d3938b754 100644
--- a/modules/c32isblank
+++ b/modules/c32isblank
@@ -14,7 +14,7 @@ iswblank
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-blank
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32iscntrl b/modules/c32iscntrl
index b3f1ac7dbb..9ec924f96a 100644
--- a/modules/c32iscntrl
+++ b/modules/c32iscntrl
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-cntrl
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isdigit b/modules/c32isdigit
index 3b82dc91b2..a9449cd6b1 100644
--- a/modules/c32isdigit
+++ b/modules/c32isdigit
@@ -14,7 +14,7 @@ iswdigit
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-digit
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isgraph b/modules/c32isgraph
index 30dc8cb2cd..6d6ef2785a 100644
--- a/modules/c32isgraph
+++ b/modules/c32isgraph
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-graph
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32islower b/modules/c32islower
index eb075f3b80..1659125631 100644
--- a/modules/c32islower
+++ b/modules/c32islower
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-lower
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isprint b/modules/c32isprint
index db7bedc980..96049e3878 100644
--- a/modules/c32isprint
+++ b/modules/c32isprint
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-print
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32ispunct b/modules/c32ispunct
index 2b132dc0b4..1e45a01a38 100644
--- a/modules/c32ispunct
+++ b/modules/c32ispunct
@@ -14,7 +14,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-punct
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isspace b/modules/c32isspace
index 144aa9b5fc..f72b6ec27b 100644
--- a/modules/c32isspace
+++ b/modules/c32isspace
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-space
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isupper b/modules/c32isupper
index 26bc18d51f..09d41ad2ec 100644
--- a/modules/c32isupper
+++ b/modules/c32isupper
@@ -13,7 +13,7 @@ wctype-h
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-upper
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32isxdigit b/modules/c32isxdigit
index f4f31c44d9..2cc4b3e21b 100644
--- a/modules/c32isxdigit
+++ b/modules/c32isxdigit
@@ -15,7 +15,7 @@ iswxdigit
 localcharset    [test $REPLACE_MBSTATE_T = 1]
 streq           [test $REPLACE_MBSTATE_T = 1]
 unictype/ctype-xdigit
-verify
+assert-h
 
 configure.ac:
 AC_REQUIRE([gl_UCHAR_H])
diff --git a/modules/c32snrtombs b/modules/c32snrtombs
index 4ced9f2628..6edf7174ed 100644
--- a/modules/c32snrtombs
+++ b/modules/c32snrtombs
@@ -9,7 +9,7 @@ lib/c32srtombs-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 c32rtomb
 wcsnrtombs      [test $SMALL_WCHAR_T = 0]
 
diff --git a/modules/c32srtombs b/modules/c32srtombs
index 1f36b6cc66..4d82ab7bdc 100644
--- a/modules/c32srtombs
+++ b/modules/c32srtombs
@@ -9,7 +9,7 @@ lib/c32srtombs-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 c32rtomb
 wcsrtombs       [test $SMALL_WCHAR_T = 0]
 
diff --git a/modules/exclude b/modules/exclude
index 13871bd635..bd785cada9 100644
--- a/modules/exclude
+++ b/modules/exclude
@@ -6,6 +6,7 @@ lib/exclude.h
 lib/exclude.c
 
 Depends-on:
+assert-h
 filename
 fnmatch
 fopen-gnu
@@ -15,7 +16,6 @@ mbuiter
 regex
 stdbool
 unlocked-io-internal
-verify
 xalloc
 
 configure.ac:
diff --git a/modules/filevercmp b/modules/filevercmp
index 4786ce11b6..6c11bb7278 100644
--- a/modules/filevercmp
+++ b/modules/filevercmp
@@ -6,10 +6,10 @@ lib/filevercmp.h
 lib/filevercmp.c
 
 Depends-on:
+assert-h
 c-ctype
 idx
 stdbool
-verify
 
 configure.ac:
 
diff --git a/modules/fma b/modules/fma
index dc45a94826..14e841842d 100644
--- a/modules/fma
+++ b/modules/fma
@@ -12,7 +12,7 @@ Depends-on:
 math
 float           [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 stdbool         [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
-verify          [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
+assert-h        [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 isfinite        [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 integer_length  [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
 frexp           [test $HAVE_FMA = 0 || test $REPLACE_FMA = 1]
diff --git a/modules/fmaf b/modules/fmaf
index 53fe229c10..8373d61bc5 100644
--- a/modules/fmaf
+++ b/modules/fmaf
@@ -14,7 +14,7 @@ math
 extensions
 float           [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 stdbool         [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
-verify          [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
+assert-h         [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 isfinite        [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 integer_length  [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
 frexpf          [test $HAVE_FMAF = 0 || test $REPLACE_FMAF = 1]
diff --git a/modules/fmal b/modules/fmal
index e24ff02a95..3927262e6a 100644
--- a/modules/fmal
+++ b/modules/fmal
@@ -15,7 +15,7 @@ extensions
 fma             [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 1]
 float           [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 stdbool         [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
-verify          [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
+assert-h        [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 isfinite        [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 integer_length  [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
 frexpl          [{ test $HAVE_FMAL = 0 || test $REPLACE_FMAL = 1; } && test $HAVE_SAME_LONG_DOUBLE_AS_DOUBLE = 0]
diff --git a/modules/fstat b/modules/fstat
index 508aa76a22..394f2fa4ed 100644
--- a/modules/fstat
+++ b/modules/fstat
@@ -14,7 +14,7 @@ pathmax         [test $REPLACE_FSTAT = 1]
 stat            [test $REPLACE_FSTAT = 1]
 stat-time       [test $REPLACE_FSTAT = 1]
 unistd          [test $REPLACE_FSTAT = 1]
-verify          [test $REPLACE_FSTAT = 1]
+assert-h        [test $REPLACE_FSTAT = 1]
 msvc-nothrow    [test $REPLACE_FSTAT = 1]
 
 configure.ac:
diff --git a/modules/i-ring b/modules/i-ring
index 374970694b..1d23a9fe51 100644
--- a/modules/i-ring
+++ b/modules/i-ring
@@ -7,8 +7,8 @@ lib/i-ring.c
 m4/i-ring.m4
 
 Depends-on:
+assert-h
 stdbool
-verify
 
 configure.ac:
 gl_I_RING
diff --git a/modules/ino-map b/modules/ino-map
index c340d1ef4c..8905b2ae9c 100644
--- a/modules/ino-map
+++ b/modules/ino-map
@@ -6,8 +6,8 @@ lib/ino-map.c
 lib/ino-map.h
 
 Depends-on:
+assert-h
 hash
-verify
 
 configure.ac:
 
diff --git a/modules/intprops-tests b/modules/intprops-tests
index f02b357584..1a230ccde8 100644
--- a/modules/intprops-tests
+++ b/modules/intprops-tests
@@ -3,9 +3,9 @@ tests/test-intprops.c
 tests/macros.h
 
 Depends-on:
+assert-h
 inttypes
 stdbool
-verify
 
 configure.ac:
 
diff --git a/modules/libgmp-tests b/modules/libgmp-tests
index a80c478c77..b0cb73d1f4 100644
--- a/modules/libgmp-tests
+++ b/modules/libgmp-tests
@@ -3,8 +3,8 @@ tests/macros.h
 tests/test-libgmp.c
 
 Depends-on:
+assert-h
 c99
-verify
 
 configure.ac:
 
diff --git a/modules/limits-h-tests b/modules/limits-h-tests
index 7a70e5782b..2cf0a41f5d 100644
--- a/modules/limits-h-tests
+++ b/modules/limits-h-tests
@@ -2,8 +2,8 @@ Files:
 tests/test-limits-h.c
 
 Depends-on:
+assert-h
 extensions
-verify
 limits-h-c++-tests
 
 configure.ac:
diff --git a/modules/locale-tests b/modules/locale-tests
index 2e661f7565..11b840da9a 100644
--- a/modules/locale-tests
+++ b/modules/locale-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-locale.c
 
 Depends-on:
-verify
+assert-h
 locale-c++-tests
 
 configure.ac:
diff --git a/modules/malloca b/modules/malloca
index 9c279c45f1..6e5fc8d566 100644
--- a/modules/malloca
+++ b/modules/malloca
@@ -9,10 +9,10 @@ m4/eealloc.m4
 
 Depends-on:
 alloca-opt
+assert-h
 idx
 stdckdint
 stdint
-verify
 xalloc-oversized
 
 configure.ac:
diff --git a/modules/mbrtoc32 b/modules/mbrtoc32
index 63ed5ebe1f..4757bcbe02 100644
--- a/modules/mbrtoc32
+++ b/modules/mbrtoc32
@@ -22,9 +22,9 @@ attribute       [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 c99             [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0]
 hard-locale     [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0]
 mbrtowc         [{ test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1; } && test $REPLACE_MBSTATE_T = 0]
+assert-h        [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 localcharset    [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 streq           [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
-verify          [test $HAVE_MBRTOC32 = 0 || test $REPLACE_MBRTOC32 = 1]
 
 configure.ac:
 gl_FUNC_MBRTOC32
diff --git a/modules/mbrtowc b/modules/mbrtowc
index ed9ebd7152..e81da6f350 100644
--- a/modules/mbrtowc
+++ b/modules/mbrtowc
@@ -26,9 +26,9 @@ attribute       [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 stdint          [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 hard-locale     [{ test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; } && test $REPLACE_MBSTATE_T = 0]
 mbsinit         [{ test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1; } && test $REPLACE_MBSTATE_T = 0]
+assert-h        [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 localcharset    [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 streq           [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
-verify          [test $HAVE_MBRTOWC = 0 || test $REPLACE_MBRTOWC = 1]
 
 configure.ac:
 gl_FUNC_MBRTOWC
diff --git a/modules/mbsinit b/modules/mbsinit
index c500620b40..1040068223 100644
--- a/modules/mbsinit
+++ b/modules/mbsinit
@@ -9,8 +9,8 @@ m4/mbstate_t.m4
 Depends-on:
 wchar
 extensions
+assert-h        [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
 mbrtowc         [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
-verify          [test $HAVE_MBSINIT = 0 || test $REPLACE_MBSINIT = 1]
 
 configure.ac:
 gl_FUNC_MBSINIT
diff --git a/modules/mbsnrtoc32s b/modules/mbsnrtoc32s
index ac464a8950..24a8458f3f 100644
--- a/modules/mbsnrtoc32s
+++ b/modules/mbsnrtoc32s
@@ -9,7 +9,7 @@ lib/mbsrtoc32s-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 mbrtoc32
 minmax
 strnlen1
diff --git a/modules/mbsrtoc32s b/modules/mbsrtoc32s
index 64892cf2a7..f9d97d7548 100644
--- a/modules/mbsrtoc32s
+++ b/modules/mbsrtoc32s
@@ -9,7 +9,7 @@ lib/mbsrtoc32s-state.c
 Depends-on:
 uchar
 wchar
-verify
+assert-h
 mbrtoc32
 strnlen1
 mbsrtowcs       [test $SMALL_WCHAR_T = 0]
diff --git a/modules/nanosleep b/modules/nanosleep
index a8d0c76744..d0855460cd 100644
--- a/modules/nanosleep
+++ b/modules/nanosleep
@@ -9,11 +9,11 @@ Depends-on:
 time
 extensions
 multiarch
+assert-h        [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 intprops        [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 pselect         [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 stdbool         [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 sys_select      [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
-verify          [test $HAVE_NANOSLEEP = 0 || test $REPLACE_NANOSLEEP = 1]
 
 configure.ac:
 gl_FUNC_NANOSLEEP
diff --git a/modules/parse-datetime b/modules/parse-datetime
index 8a2d050dee..72aa6af659 100644
--- a/modules/parse-datetime
+++ b/modules/parse-datetime
@@ -9,6 +9,7 @@ m4/tm_gmtoff.m4
 m4/parse-datetime.m4
 
 Depends-on:
+assert-h
 bison
 c99
 c-ctype
@@ -26,7 +27,6 @@ time
 time_r
 time_rz
 timegm
-verify
 
 configure.ac:
 gl_PARSE_DATETIME
diff --git a/modules/pipe2 b/modules/pipe2
index 08758ba77a..a933d626f0 100644
--- a/modules/pipe2
+++ b/modules/pipe2
@@ -10,7 +10,7 @@ unistd
 fcntl-h
 binary-io
 extensions
-verify
+assert-h
 
 configure.ac:
 gl_FUNC_PIPE2
diff --git a/modules/pthread-h-tests b/modules/pthread-h-tests
index 13fd05b3a0..962ff0e7ca 100644
--- a/modules/pthread-h-tests
+++ b/modules/pthread-h-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-pthread.c
 
 Depends-on:
-verify
+assert-h
 pthread-h-c++-tests
 
 configure.ac:
diff --git a/modules/rawmemchr b/modules/rawmemchr
index f3e46881d5..03da3a27b7 100644
--- a/modules/rawmemchr
+++ b/modules/rawmemchr
@@ -7,11 +7,11 @@ lib/rawmemchr.valgrind
 m4/rawmemchr.m4
 
 Depends-on:
+assert-h
 extensions
 stdalign
 stdint
 string
-verify
 
 configure.ac:
 gl_FUNC_RAWMEMCHR
diff --git a/modules/relocatable-prog-wrapper b/modules/relocatable-prog-wrapper
index 9b9d9c3abe..a60aa24d67 100644
--- a/modules/relocatable-prog-wrapper
+++ b/modules/relocatable-prog-wrapper
@@ -51,6 +51,7 @@ m4/relocatable-lib.m4
 m4/setenv.m4
 
 Depends-on:
+assert-h
 c99
 double-slash-root
 eloop-threshold
@@ -73,7 +74,6 @@ stdlib
 string
 sys_stat
 unistd
-verify
 xalloc-oversized
 
 configure.ac-early:
diff --git a/modules/round-tests b/modules/round-tests
index 2c4b37bf6e..6a0de71cf7 100644
--- a/modules/round-tests
+++ b/modules/round-tests
@@ -8,10 +8,10 @@ tests/signature.h
 tests/macros.h
 
 Depends-on:
+assert-h
 isnand-nolibm
 stdbool
 stdint
-verify
 
 configure.ac:
 
diff --git a/modules/roundf-tests b/modules/roundf-tests
index cd8af30202..29f06e45c2 100644
--- a/modules/roundf-tests
+++ b/modules/roundf-tests
@@ -9,12 +9,12 @@ tests/signature.h
 tests/macros.h
 
 Depends-on:
+assert-h
 ceilf
 floorf
 isnanf-nolibm
 stdbool
 stdint
-verify
 
 configure.ac:
 
diff --git a/modules/sleep b/modules/sleep
index 8ce74a43d9..fb81ebd683 100644
--- a/modules/sleep
+++ b/modules/sleep
@@ -7,8 +7,8 @@ m4/sleep.m4
 
 Depends-on:
 unistd
+assert-h        [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
 stdint          [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
-verify          [test $HAVE_SLEEP = 0 || test $REPLACE_SLEEP = 1]
 
 configure.ac:
 gl_FUNC_SLEEP
diff --git a/modules/stat b/modules/stat
index 96d7a03fd5..0d01ab6055 100644
--- a/modules/stat
+++ b/modules/stat
@@ -10,12 +10,12 @@ m4/stat.m4
 Depends-on:
 sys_stat
 largefile
+assert-h        [test $REPLACE_STAT = 1]
 filename        [test $REPLACE_STAT = 1]
 malloca         [test $REPLACE_STAT = 1]
 pathmax         [test $REPLACE_STAT = 1]
 stat-time       [test $REPLACE_STAT = 1]
 stdbool         [test $REPLACE_STAT = 1]
-verify          [test $REPLACE_STAT = 1]
 
 configure.ac:
 gl_FUNC_STAT
diff --git a/modules/stdalign-tests b/modules/stdalign-tests
index 138fe3550e..e4665ed5fc 100644
--- a/modules/stdalign-tests
+++ b/modules/stdalign-tests
@@ -3,7 +3,7 @@ tests/test-stdalign.c
 tests/macros.h
 
 Depends-on:
-verify
+assert-h
 stdint
 stdalign-c++-tests
 
diff --git a/modules/stdckdint-tests b/modules/stdckdint-tests
index fb809dac3e..a4115ca44b 100644
--- a/modules/stdckdint-tests
+++ b/modules/stdckdint-tests
@@ -4,9 +4,9 @@ tests/test-intprops.c
 tests/test-stdckdint.c
 
 Depends-on:
+assert-h
 inttypes
 stdbool
-verify
 stdckdint-c++-tests
 
 configure.ac:
diff --git a/modules/stddef-tests b/modules/stddef-tests
index bb71e110b7..644eb0d7aa 100644
--- a/modules/stddef-tests
+++ b/modules/stddef-tests
@@ -2,8 +2,8 @@ Files:
 tests/test-stddef.c
 
 Depends-on:
+assert-h
 stdalign
-verify
 stddef-c++-tests
 
 configure.ac:
diff --git a/modules/stdio-tests b/modules/stdio-tests
index fcda690b7a..5368a2c64c 100644
--- a/modules/stdio-tests
+++ b/modules/stdio-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-stdio.c
 
 Depends-on:
-verify
+assert-h
 stdio-c++-tests
 fgetc-tests
 fputc-tests
diff --git a/modules/stdlib-tests b/modules/stdlib-tests
index 7225c65b8b..f7184bb4e1 100644
--- a/modules/stdlib-tests
+++ b/modules/stdlib-tests
@@ -3,7 +3,7 @@ tests/test-stdlib.c
 tests/test-sys_wait.h
 
 Depends-on:
-verify
+assert-h
 stdlib-c++-tests
 
 configure.ac:
diff --git a/modules/strerror b/modules/strerror
index 6ed290e929..acd17dee0a 100644
--- a/modules/strerror
+++ b/modules/strerror
@@ -7,10 +7,10 @@ m4/strerror.m4
 
 Depends-on:
 string
+assert-h         [test $REPLACE_STRERROR = 1]
 errno            [test $REPLACE_STRERROR = 1]
 intprops         [test $REPLACE_STRERROR = 1]
 strerror-override [test $REPLACE_STRERROR = 1]
-verify           [test $REPLACE_STRERROR = 1]
 
 configure.ac:
 gl_FUNC_STRERROR
diff --git a/modules/string-tests b/modules/string-tests
index ec732da6a3..b469c2e048 100644
--- a/modules/string-tests
+++ b/modules/string-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-string.c
 
 Depends-on:
-verify
+assert-h
 string-c++-tests
 
 configure.ac:
diff --git a/modules/strtoimax b/modules/strtoimax
index 80aa1dde65..942fb55a18 100644
--- a/modules/strtoimax
+++ b/modules/strtoimax
@@ -7,7 +7,7 @@ m4/strtoimax.m4
 
 Depends-on:
 inttypes-incomplete
-verify          [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
+assert-h        [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
 stdint          [test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1]
 strtoll         [{ test $HAVE_DECL_STRTOIMAX = 0 || test $REPLACE_STRTOIMAX = 1; } && test $ac_cv_type_long_long_int = yes]
 
diff --git a/modules/strtoumax b/modules/strtoumax
index 3d6bbf7281..5dfdd65ea2 100644
--- a/modules/strtoumax
+++ b/modules/strtoumax
@@ -8,7 +8,7 @@ m4/strtoumax.m4
 
 Depends-on:
 inttypes-incomplete
-verify          [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
+assert-h        [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
 stdint          [test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1]
 strtoull        [{ test $HAVE_DECL_STRTOUMAX = 0 || test $REPLACE_STRTOUMAX = 1; } && test $ac_cv_type_unsigned_long_long_int = yes]
 
diff --git a/modules/sys_stat-tests b/modules/sys_stat-tests
index a5ede77aba..7d4091bd75 100644
--- a/modules/sys_stat-tests
+++ b/modules/sys_stat-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-sys_stat.c
 
 Depends-on:
-verify
+assert-h
 sys_stat-c++-tests
 
 configure.ac:
diff --git a/modules/time-tests b/modules/time-tests
index de7e2383c8..e367565ece 100644
--- a/modules/time-tests
+++ b/modules/time-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-time.c
 
 Depends-on:
-verify
+assert-h
 time-c++-tests
 
 configure.ac:
diff --git a/modules/uchar-tests b/modules/uchar-tests
index 2dab71805b..5df13a09a4 100644
--- a/modules/uchar-tests
+++ b/modules/uchar-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-uchar.c
 
 Depends-on:
-verify
+assert-h
 uchar-c++-tests
 
 configure.ac:
diff --git a/modules/unistd-tests b/modules/unistd-tests
index 9b8222c604..e9ce6e0a3d 100644
--- a/modules/unistd-tests
+++ b/modules/unistd-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-unistd.c
 
 Depends-on:
-verify
+assert-h
 unistd-c++-tests
 
 configure.ac:
diff --git a/modules/unistdio/u16-u16-vasnprintf b/modules/unistdio/u16-u16-vasnprintf
index 9c27ccc7f5..ac8df9f1b1 100644
--- a/modules/unistdio/u16-u16-vasnprintf
+++ b/modules/unistdio/u16-u16-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u16-vasnprintf b/modules/unistdio/u16-vasnprintf
index 285640b6ea..e767f54bd3 100644
--- a/modules/unistdio/u16-vasnprintf
+++ b/modules/unistdio/u16-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u32-u32-vasnprintf b/modules/unistdio/u32-u32-vasnprintf
index c4fe86d61d..86e669723b 100644
--- a/modules/unistdio/u32-u32-vasnprintf
+++ b/modules/unistdio/u32-u32-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u32-vasnprintf b/modules/unistdio/u32-vasnprintf
index a7582ff922..58185bc34b 100644
--- a/modules/unistdio/u32-vasnprintf
+++ b/modules/unistdio/u32-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u8-u8-vasnprintf b/modules/unistdio/u8-u8-vasnprintf
index a583f3442d..63ab8d8768 100644
--- a/modules/unistdio/u8-u8-vasnprintf
+++ b/modules/unistdio/u8-u8-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/u8-vasnprintf b/modules/unistdio/u8-vasnprintf
index 3fdaa9ce38..f6be0a5de3 100644
--- a/modules/unistdio/u8-vasnprintf
+++ b/modules/unistdio/u8-vasnprintf
@@ -47,7 +47,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/unistdio/ulc-vasnprintf b/modules/unistdio/ulc-vasnprintf
index 5691007019..61107fe13a 100644
--- a/modules/unistdio/ulc-vasnprintf
+++ b/modules/unistdio/ulc-vasnprintf
@@ -45,7 +45,7 @@ errno
 free-posix
 memchr
 multiarch
-verify
+assert-h
 
 configure.ac:
 gl_PREREQ_VASNPRINTF_WITH_EXTRAS
diff --git a/modules/utimecmp b/modules/utimecmp
index dffe861c2d..af6b8c2898 100644
--- a/modules/utimecmp
+++ b/modules/utimecmp
@@ -16,7 +16,7 @@ utimensat
 intprops
 stdbool
 stdint
-verify
+assert-h
 
 configure.ac:
 gl_UTIMECMP
diff --git a/modules/vasnprintf b/modules/vasnprintf
index bcde2b9cfd..7d40973cdb 100644
--- a/modules/vasnprintf
+++ b/modules/vasnprintf
@@ -30,7 +30,7 @@ stdint
 xsize
 errno
 memchr
-verify
+assert-h
 wchar
 
 configure.ac:
diff --git a/modules/wchar-tests b/modules/wchar-tests
index afe3bff752..3e6b6cf3f7 100644
--- a/modules/wchar-tests
+++ b/modules/wchar-tests
@@ -2,7 +2,7 @@ Files:
 tests/test-wchar.c
 
 Depends-on:
-verify
+assert-h
 wchar-c++-tests
 
 configure.ac:
diff --git a/tests/test-alignof.c b/tests/test-alignof.c
index fd11789932..0e516f5d1b 100644
--- a/tests/test-alignof.c
+++ b/tests/test-alignof.c
@@ -23,8 +23,6 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include "verify.h"
-
 typedef long double longdouble;
 typedef struct { char a[1]; } struct1;
 typedef struct { char a[2]; } struct2;
@@ -33,7 +31,7 @@ typedef struct { char a[4]; } struct4;
 
 #define CHECK(type) \
   typedef struct { char slot1; type slot2; } type##_helper; \
-  verify (alignof_slot (type) == offsetof (type##_helper, slot2)); \
+  static_assert (alignof_slot (type) == offsetof (type##_helper, slot2)); \
   const int type##_slot_alignment = alignof_slot (type); \
   const int type##_type_alignment = alignof_type (type);
 
diff --git a/tests/test-intprops.c b/tests/test-intprops.c
index 84265ea3f2..a54d581229 100644
--- a/tests/test-intprops.c
+++ b/tests/test-intprops.c
@@ -35,7 +35,6 @@
 #else
 # include "intprops.h"
 #endif
-#include "verify.h"
 
 #include <inttypes.h>
 #include <limits.h>
@@ -44,7 +43,7 @@
 
 /* Compile-time verification of expression X.
    In this file, we need it as a statement, rather than as a declaration.  */
-#define verify_stmt(x) do { verify (x); } while (0)
+#define verify_stmt(x) do { static_assert (x); } while (0)
 
 /* VERIFY (X) uses a static assertion for compilers that are known to work,
    and falls back on a dynamic assertion for other compilers.
diff --git a/tests/test-libgmp.c b/tests/test-libgmp.c
index fcb77d3885..ec1766affd 100644
--- a/tests/test-libgmp.c
+++ b/tests/test-libgmp.c
@@ -22,14 +22,12 @@
 #include <limits.h>
 #include <string.h>
 
-#include "verify.h"
-
 #include "macros.h"
 
 #ifndef MINI_GMP_LIMB_TYPE
 /* Verify that the gmp.h header file was generated for the same
    machine word size as we are using.  */
-verify (GMP_NUMB_BITS == sizeof (mp_limb_t) * CHAR_BIT);
+static_assert (GMP_NUMB_BITS == sizeof (mp_limb_t) * CHAR_BIT);
 #endif
 
 int
diff --git a/tests/test-limits-h.c b/tests/test-limits-h.c
index 5da02f0575..ddcb5d5648 100644
--- a/tests/test-limits-h.c
+++ b/tests/test-limits-h.c
@@ -20,14 +20,12 @@
 
 #include <limits.h>
 
-#include "verify.h"
-
 #if 4 < __GNUC__ + (3 <= __GNUC_MINOR__)
 # pragma GCC diagnostic ignored "-Woverlength-strings"
 #endif
 
 #define verify_width(width, min, max) \
-  verify ((max) >> ((width) - 1 - ((min) < 0)) == 1)
+  static_assert ((max) >> ((width) - 1 - ((min) < 0)) == 1)
 
 /* Macros borrowed from intprops.h.  */
 #define TYPE_SIGNED(t) (! ((t) 0 < (t) -1))
@@ -53,48 +51,48 @@ verify_width (LONG_BIT, LONG_MIN, LONG_MAX);
 /* Numerical limit macros.  */
 
 char               limits1[]  = { CHAR_MIN, CHAR_MAX };
-verify (TYPE_MINIMUM (char) == CHAR_MIN);
-verify (TYPE_MAXIMUM (char) == CHAR_MAX);
+static_assert (TYPE_MINIMUM (char) == CHAR_MIN);
+static_assert (TYPE_MAXIMUM (char) == CHAR_MAX);
 
 signed char        limits2[]  = { SCHAR_MIN, SCHAR_MAX };
-verify (TYPE_MINIMUM (signed char) == SCHAR_MIN);
-verify (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
+static_assert (TYPE_MINIMUM (signed char) == SCHAR_MIN);
+static_assert (TYPE_MAXIMUM (signed char) == SCHAR_MAX);
 
 unsigned char      limits3[]  = { UCHAR_MAX };
-verify (TYPE_MINIMUM (unsigned char) == 0);
-verify (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
+static_assert (TYPE_MINIMUM (unsigned char) == 0);
+static_assert (TYPE_MAXIMUM (unsigned char) == UCHAR_MAX);
 
 short              limits4[]  = { SHRT_MIN, SHRT_MAX };
-verify (TYPE_MINIMUM (short int) == SHRT_MIN);
-verify (TYPE_MAXIMUM (short int) == SHRT_MAX);
+static_assert (TYPE_MINIMUM (short int) == SHRT_MIN);
+static_assert (TYPE_MAXIMUM (short int) == SHRT_MAX);
 
 unsigned short     limits5[]  = { USHRT_MAX };
-verify (TYPE_MINIMUM (unsigned short int) == 0);
-verify (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
+static_assert (TYPE_MINIMUM (unsigned short int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned short int) == USHRT_MAX);
 
 int                limits6[]  = { INT_MIN, INT_MAX };
-verify (TYPE_MINIMUM (int) == INT_MIN);
-verify (TYPE_MAXIMUM (int) == INT_MAX);
+static_assert (TYPE_MINIMUM (int) == INT_MIN);
+static_assert (TYPE_MAXIMUM (int) == INT_MAX);
 
 unsigned int       limits7[]  = { UINT_MAX };
-verify (TYPE_MINIMUM (unsigned int) == 0);
-verify (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
+static_assert (TYPE_MINIMUM (unsigned int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned int) == UINT_MAX);
 
 long               limits8[]  = { LONG_MIN, LONG_MAX };
-verify (TYPE_MINIMUM (long int) == LONG_MIN);
-verify (TYPE_MAXIMUM (long int) == LONG_MAX);
+static_assert (TYPE_MINIMUM (long int) == LONG_MIN);
+static_assert (TYPE_MAXIMUM (long int) == LONG_MAX);
 
 unsigned long      limits9[]  = { ULONG_MAX };
-verify (TYPE_MINIMUM (unsigned long int) == 0);
-verify (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
+static_assert (TYPE_MINIMUM (unsigned long int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned long int) == ULONG_MAX);
 
 long long          limits10[] = { LLONG_MIN, LLONG_MAX };
-verify (TYPE_MINIMUM (long long int) == LLONG_MIN);
-verify (TYPE_MAXIMUM (long long int) == LLONG_MAX);
+static_assert (TYPE_MINIMUM (long long int) == LLONG_MIN);
+static_assert (TYPE_MAXIMUM (long long int) == LLONG_MAX);
 
 unsigned long long limits11[] = { ULLONG_MAX };
-verify (TYPE_MINIMUM (unsigned long long int) == 0);
-verify (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
+static_assert (TYPE_MINIMUM (unsigned long long int) == 0);
+static_assert (TYPE_MAXIMUM (unsigned long long int) == ULLONG_MAX);
 
 /* Macros specified by ISO/IEC TS 18661-1:2014.  */
 
@@ -113,7 +111,7 @@ verify_width (ULLONG_WIDTH, 0, ULLONG_MAX);
 /* Macros specified by C2x.  */
 
 int bool_attrs[] = { BOOL_MAX, BOOL_WIDTH };
-verify (BOOL_MAX == (((1U << (BOOL_WIDTH - 1)) - 1) * 2) + 1);
+static_assert (BOOL_MAX == (((1U << (BOOL_WIDTH - 1)) - 1) * 2) + 1);
 
 int
 main (void)
diff --git a/tests/test-locale.c b/tests/test-locale.c
index 5c2bac1009..3aad7d85a8 100644
--- a/tests/test-locale.c
+++ b/tests/test-locale.c
@@ -20,8 +20,6 @@
 
 #include <locale.h>
 
-#include "verify.h"
-
 int a[] =
   {
     LC_ALL,
@@ -39,7 +37,7 @@ int ls;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 int
 main ()
diff --git a/tests/test-pthread.c b/tests/test-pthread.c
index 86131d867a..2fef5924e8 100644
--- a/tests/test-pthread.c
+++ b/tests/test-pthread.c
@@ -20,8 +20,6 @@
 
 #include <pthread.h>
 
-#include "verify.h"
-
 /* Check that the types are all defined.  */
 
 pthread_t t1;
diff --git a/tests/test-round2.c b/tests/test-round2.c
index 4cc37c59bf..05600eab7c 100644
--- a/tests/test-round2.c
+++ b/tests/test-round2.c
@@ -34,8 +34,6 @@
 #include <stdio.h>
 #include <stdlib.h>
 
-#include "verify.h"
-
 #ifdef USE_LONG_DOUBLE
 # error Long double not supported.
 #elif ! defined USE_FLOAT
@@ -99,7 +97,7 @@ main (void)
         /* Combine highbits and lowbits into a floating-point number,
            sign-extending the lowbits to DOUBLE_BITS-NUM_HIGHBITS bits.  */
         union { DOUBLE f; DOUBLE_UINT i; } janus;
-        verify (sizeof janus.f == sizeof janus.i);
+        static_assert (sizeof janus.f == sizeof janus.i);
         janus.i = lowbits | (highbits << (DOUBLE_BITS - NUM_HIGHBITS));
         if (lowbits >> (NUM_LOWBITS - 1))
           janus.i |= ((DOUBLE_UINT) -1
diff --git a/tests/test-stdalign.c b/tests/test-stdalign.c
index 69268b87b4..ea07543802 100644
--- a/tests/test-stdalign.c
+++ b/tests/test-stdalign.c
@@ -23,8 +23,6 @@
 #include <stddef.h>
 #include <stdint.h>
 
-#include "verify.h"
-
 #include "macros.h"
 
 typedef long double longdouble;
@@ -45,7 +43,7 @@ typedef struct { char a[4]; } struct4;
 
 #define CHECK_STATIC(type) \
   typedef struct { char slot1; type slot2; } type##_helper; \
-  verify (alignof (type) == offsetof (type##_helper, slot2)); \
+  static_assert (alignof (type) == offsetof (type##_helper, slot2)); \
   const int type##_alignment = alignof (type); \
   type alignas (TEST_ALIGNMENT) static_##type##_alignas
 
diff --git a/tests/test-stddef.c b/tests/test-stddef.c
index 9983154e92..470c7a6bc1 100644
--- a/tests/test-stddef.c
+++ b/tests/test-stddef.c
@@ -21,7 +21,6 @@
 #include <stddef.h>
 #include <limits.h>
 #include <stdalign.h>
-#include "verify.h"
 
 /* Check that appropriate types are defined.  */
 wchar_t a = 'c';
@@ -31,7 +30,7 @@ max_align_t x;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that offsetof produces integer constants with correct type.  */
 struct d
@@ -42,32 +41,32 @@ struct d
 /* Solaris 10 has a bug where offsetof is under-parenthesized, and
    cannot be used as an arbitrary expression.  However, since it is
    unlikely to bite real code, we ignore that short-coming.  */
-/* verify (sizeof offsetof (struct d, e) == sizeof (size_t)); */
-verify (sizeof (offsetof (struct d, e)) == sizeof (size_t));
-verify (offsetof (struct d, f) == 1);
+/* static_assert (sizeof offsetof (struct d, e) == sizeof (size_t)); */
+static_assert (sizeof (offsetof (struct d, e)) == sizeof (size_t));
+static_assert (offsetof (struct d, f) == 1);
 
 /* offsetof promotes to an unsigned integer if and only if sizes do
    not fit in int.  */
-verify ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1));
+static_assert ((offsetof (struct d, e) < -1) == (INT_MAX < (size_t) -1));
 
 /* Check max_align_t's alignment.  */
-verify (alignof (double) <= alignof (max_align_t));
-verify (alignof (int) <= alignof (max_align_t));
-verify (alignof (long double) <= alignof (max_align_t));
-verify (alignof (long int) <= alignof (max_align_t));
-verify (alignof (ptrdiff_t) <= alignof (max_align_t));
-verify (alignof (size_t) <= alignof (max_align_t));
-verify (alignof (wchar_t) <= alignof (max_align_t));
-verify (alignof (struct d) <= alignof (max_align_t));
+static_assert (alignof (double) <= alignof (max_align_t));
+static_assert (alignof (int) <= alignof (max_align_t));
+static_assert (alignof (long double) <= alignof (max_align_t));
+static_assert (alignof (long int) <= alignof (max_align_t));
+static_assert (alignof (ptrdiff_t) <= alignof (max_align_t));
+static_assert (alignof (size_t) <= alignof (max_align_t));
+static_assert (alignof (wchar_t) <= alignof (max_align_t));
+static_assert (alignof (struct d) <= alignof (max_align_t));
 #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__
-verify (__alignof__ (double) <= __alignof__ (max_align_t));
-verify (__alignof__ (int) <= __alignof__ (max_align_t));
-verify (__alignof__ (long double) <= __alignof__ (max_align_t));
-verify (__alignof__ (long int) <= __alignof__ (max_align_t));
-verify (__alignof__ (ptrdiff_t) <= __alignof__ (max_align_t));
-verify (__alignof__ (size_t) <= __alignof__ (max_align_t));
-verify (__alignof__ (wchar_t) <= __alignof__ (max_align_t));
-verify (__alignof__ (struct d) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (double) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (int) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (long double) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (long int) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (ptrdiff_t) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (size_t) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (wchar_t) <= __alignof__ (max_align_t));
+static_assert (__alignof__ (struct d) <= __alignof__ (max_align_t));
 #endif
 
 int
diff --git a/tests/test-stdio.c b/tests/test-stdio.c
index 695532ad95..1908da358a 100644
--- a/tests/test-stdio.c
+++ b/tests/test-stdio.c
@@ -20,14 +20,12 @@
 
 #include <stdio.h>
 
-#include "verify.h"
-
 /* Check that the various SEEK_* macros are defined.  */
 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that the types are all defined.  */
 fpos_t t1;
diff --git a/tests/test-stdlib.c b/tests/test-stdlib.c
index 4f1b965818..4fdafc9946 100644
--- a/tests/test-stdlib.c
+++ b/tests/test-stdlib.c
@@ -20,8 +20,6 @@
 
 #include <stdlib.h>
 
-#include "verify.h"
-
 /* Check that EXIT_SUCCESS is 0, per POSIX.  */
 static int exitcode = EXIT_SUCCESS;
 #if EXIT_SUCCESS
@@ -36,7 +34,7 @@ static int exitcode = EXIT_SUCCESS;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 #if GNULIB_TEST_SYSTEM_POSIX
 # include "test-sys_wait.h"
diff --git a/tests/test-string.c b/tests/test-string.c
index 9509a6a5d9..94688726dd 100644
--- a/tests/test-string.c
+++ b/tests/test-string.c
@@ -20,11 +20,9 @@
 
 #include <string.h>
 
-#include "verify.h"
-
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 int
 main (void)
diff --git a/tests/test-sys_stat.c b/tests/test-sys_stat.c
index 913b17e995..b404d9f22c 100644
--- a/tests/test-sys_stat.c
+++ b/tests/test-sys_stat.c
@@ -20,8 +20,6 @@
 
 #include <sys/stat.h>
 
-#include "verify.h"
-
 /* Check the existence of some macros.  */
 int a[] =
   {
@@ -61,264 +59,264 @@ int a[] =
 
 /* Sanity checks.  */
 
-verify (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR));
-verify (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP));
-verify (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH));
+static_assert (S_IRWXU == (S_IRUSR | S_IWUSR | S_IXUSR));
+static_assert (S_IRWXG == (S_IRGRP | S_IWGRP | S_IXGRP));
+static_assert (S_IRWXO == (S_IROTH | S_IWOTH | S_IXOTH));
 
 #ifdef S_IFBLK
-verify (S_ISBLK (S_IFBLK));
+static_assert (S_ISBLK (S_IFBLK));
 #endif
-verify (!S_ISBLK (S_IFCHR));
-verify (!S_ISBLK (S_IFDIR));
-verify (!S_ISBLK (S_IFIFO));
-verify (!S_ISBLK (S_IFREG));
+static_assert (!S_ISBLK (S_IFCHR));
+static_assert (!S_ISBLK (S_IFDIR));
+static_assert (!S_ISBLK (S_IFIFO));
+static_assert (!S_ISBLK (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISBLK (S_IFLNK));
+static_assert (!S_ISBLK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISBLK (S_IFSOCK));
+static_assert (!S_ISBLK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISCHR (S_IFBLK));
+static_assert (!S_ISCHR (S_IFBLK));
 #endif
-verify (S_ISCHR (S_IFCHR));
-verify (!S_ISCHR (S_IFDIR));
-verify (!S_ISCHR (S_IFIFO));
-verify (!S_ISCHR (S_IFREG));
+static_assert (S_ISCHR (S_IFCHR));
+static_assert (!S_ISCHR (S_IFDIR));
+static_assert (!S_ISCHR (S_IFIFO));
+static_assert (!S_ISCHR (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISCHR (S_IFLNK));
+static_assert (!S_ISCHR (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISCHR (S_IFSOCK));
+static_assert (!S_ISCHR (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISDIR (S_IFBLK));
+static_assert (!S_ISDIR (S_IFBLK));
 #endif
-verify (!S_ISDIR (S_IFCHR));
-verify (S_ISDIR (S_IFDIR));
-verify (!S_ISDIR (S_IFIFO));
-verify (!S_ISDIR (S_IFREG));
+static_assert (!S_ISDIR (S_IFCHR));
+static_assert (S_ISDIR (S_IFDIR));
+static_assert (!S_ISDIR (S_IFIFO));
+static_assert (!S_ISDIR (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISDIR (S_IFLNK));
+static_assert (!S_ISDIR (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISDIR (S_IFSOCK));
+static_assert (!S_ISDIR (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISFIFO (S_IFBLK));
+static_assert (!S_ISFIFO (S_IFBLK));
 #endif
-verify (!S_ISFIFO (S_IFCHR));
-verify (!S_ISFIFO (S_IFDIR));
-verify (S_ISFIFO (S_IFIFO));
-verify (!S_ISFIFO (S_IFREG));
+static_assert (!S_ISFIFO (S_IFCHR));
+static_assert (!S_ISFIFO (S_IFDIR));
+static_assert (S_ISFIFO (S_IFIFO));
+static_assert (!S_ISFIFO (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISFIFO (S_IFLNK));
+static_assert (!S_ISFIFO (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISFIFO (S_IFSOCK));
+static_assert (!S_ISFIFO (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISREG (S_IFBLK));
+static_assert (!S_ISREG (S_IFBLK));
 #endif
-verify (!S_ISREG (S_IFCHR));
-verify (!S_ISREG (S_IFDIR));
-verify (!S_ISREG (S_IFIFO));
-verify (S_ISREG (S_IFREG));
+static_assert (!S_ISREG (S_IFCHR));
+static_assert (!S_ISREG (S_IFDIR));
+static_assert (!S_ISREG (S_IFIFO));
+static_assert (S_ISREG (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISREG (S_IFLNK));
+static_assert (!S_ISREG (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISREG (S_IFSOCK));
+static_assert (!S_ISREG (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISLNK (S_IFBLK));
+static_assert (!S_ISLNK (S_IFBLK));
 #endif
-verify (!S_ISLNK (S_IFCHR));
-verify (!S_ISLNK (S_IFDIR));
-verify (!S_ISLNK (S_IFIFO));
-verify (!S_ISLNK (S_IFREG));
+static_assert (!S_ISLNK (S_IFCHR));
+static_assert (!S_ISLNK (S_IFDIR));
+static_assert (!S_ISLNK (S_IFIFO));
+static_assert (!S_ISLNK (S_IFREG));
 #ifdef S_IFLNK
-verify (S_ISLNK (S_IFLNK));
+static_assert (S_ISLNK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISLNK (S_IFSOCK));
+static_assert (!S_ISLNK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISSOCK (S_IFBLK));
+static_assert (!S_ISSOCK (S_IFBLK));
 #endif
-verify (!S_ISSOCK (S_IFCHR));
-verify (!S_ISSOCK (S_IFDIR));
-verify (!S_ISSOCK (S_IFIFO));
-verify (!S_ISSOCK (S_IFREG));
+static_assert (!S_ISSOCK (S_IFCHR));
+static_assert (!S_ISSOCK (S_IFDIR));
+static_assert (!S_ISSOCK (S_IFIFO));
+static_assert (!S_ISSOCK (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISSOCK (S_IFLNK));
+static_assert (!S_ISSOCK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (S_ISSOCK (S_IFSOCK));
+static_assert (S_ISSOCK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISDOOR (S_IFBLK));
+static_assert (!S_ISDOOR (S_IFBLK));
 #endif
-verify (!S_ISDOOR (S_IFCHR));
-verify (!S_ISDOOR (S_IFDIR));
-verify (!S_ISDOOR (S_IFIFO));
-verify (!S_ISDOOR (S_IFREG));
+static_assert (!S_ISDOOR (S_IFCHR));
+static_assert (!S_ISDOOR (S_IFDIR));
+static_assert (!S_ISDOOR (S_IFIFO));
+static_assert (!S_ISDOOR (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISDOOR (S_IFLNK));
+static_assert (!S_ISDOOR (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISDOOR (S_IFSOCK));
+static_assert (!S_ISDOOR (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISMPB (S_IFBLK));
+static_assert (!S_ISMPB (S_IFBLK));
 #endif
-verify (!S_ISMPB (S_IFCHR));
-verify (!S_ISMPB (S_IFDIR));
-verify (!S_ISMPB (S_IFIFO));
-verify (!S_ISMPB (S_IFREG));
+static_assert (!S_ISMPB (S_IFCHR));
+static_assert (!S_ISMPB (S_IFDIR));
+static_assert (!S_ISMPB (S_IFIFO));
+static_assert (!S_ISMPB (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISMPB (S_IFLNK));
+static_assert (!S_ISMPB (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISMPB (S_IFSOCK));
+static_assert (!S_ISMPB (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISMPX (S_IFBLK));
+static_assert (!S_ISMPX (S_IFBLK));
 #endif
-verify (!S_ISMPX (S_IFCHR));
-verify (!S_ISMPX (S_IFDIR));
-verify (!S_ISMPX (S_IFIFO));
-verify (!S_ISMPX (S_IFREG));
+static_assert (!S_ISMPX (S_IFCHR));
+static_assert (!S_ISMPX (S_IFDIR));
+static_assert (!S_ISMPX (S_IFIFO));
+static_assert (!S_ISMPX (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISMPX (S_IFLNK));
+static_assert (!S_ISMPX (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISMPX (S_IFSOCK));
+static_assert (!S_ISMPX (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISNAM (S_IFBLK));
+static_assert (!S_ISNAM (S_IFBLK));
 #endif
-verify (!S_ISNAM (S_IFCHR));
-verify (!S_ISNAM (S_IFDIR));
-verify (!S_ISNAM (S_IFIFO));
-verify (!S_ISNAM (S_IFREG));
+static_assert (!S_ISNAM (S_IFCHR));
+static_assert (!S_ISNAM (S_IFDIR));
+static_assert (!S_ISNAM (S_IFIFO));
+static_assert (!S_ISNAM (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISNAM (S_IFLNK));
+static_assert (!S_ISNAM (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISNAM (S_IFSOCK));
+static_assert (!S_ISNAM (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISNWK (S_IFBLK));
+static_assert (!S_ISNWK (S_IFBLK));
 #endif
-verify (!S_ISNWK (S_IFCHR));
-verify (!S_ISNWK (S_IFDIR));
-verify (!S_ISNWK (S_IFIFO));
-verify (!S_ISNWK (S_IFREG));
+static_assert (!S_ISNWK (S_IFCHR));
+static_assert (!S_ISNWK (S_IFDIR));
+static_assert (!S_ISNWK (S_IFIFO));
+static_assert (!S_ISNWK (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISNWK (S_IFLNK));
+static_assert (!S_ISNWK (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISNWK (S_IFSOCK));
+static_assert (!S_ISNWK (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISPORT (S_IFBLK));
+static_assert (!S_ISPORT (S_IFBLK));
 #endif
-verify (!S_ISPORT (S_IFCHR));
-verify (!S_ISPORT (S_IFDIR));
-verify (!S_ISPORT (S_IFIFO));
-verify (!S_ISPORT (S_IFREG));
+static_assert (!S_ISPORT (S_IFCHR));
+static_assert (!S_ISPORT (S_IFDIR));
+static_assert (!S_ISPORT (S_IFIFO));
+static_assert (!S_ISPORT (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISPORT (S_IFLNK));
+static_assert (!S_ISPORT (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISPORT (S_IFSOCK));
+static_assert (!S_ISPORT (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISCTG (S_IFBLK));
+static_assert (!S_ISCTG (S_IFBLK));
 #endif
-verify (!S_ISCTG (S_IFCHR));
-verify (!S_ISCTG (S_IFDIR));
-verify (!S_ISCTG (S_IFIFO));
-verify (!S_ISCTG (S_IFREG));
+static_assert (!S_ISCTG (S_IFCHR));
+static_assert (!S_ISCTG (S_IFDIR));
+static_assert (!S_ISCTG (S_IFIFO));
+static_assert (!S_ISCTG (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISCTG (S_IFLNK));
+static_assert (!S_ISCTG (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISCTG (S_IFSOCK));
+static_assert (!S_ISCTG (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISOFD (S_IFBLK));
+static_assert (!S_ISOFD (S_IFBLK));
 #endif
-verify (!S_ISOFD (S_IFCHR));
-verify (!S_ISOFD (S_IFDIR));
-verify (!S_ISOFD (S_IFIFO));
-verify (!S_ISOFD (S_IFREG));
+static_assert (!S_ISOFD (S_IFCHR));
+static_assert (!S_ISOFD (S_IFDIR));
+static_assert (!S_ISOFD (S_IFIFO));
+static_assert (!S_ISOFD (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISOFD (S_IFLNK));
+static_assert (!S_ISOFD (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISOFD (S_IFSOCK));
+static_assert (!S_ISOFD (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISOFL (S_IFBLK));
+static_assert (!S_ISOFL (S_IFBLK));
 #endif
-verify (!S_ISOFL (S_IFCHR));
-verify (!S_ISOFL (S_IFDIR));
-verify (!S_ISOFL (S_IFIFO));
-verify (!S_ISOFL (S_IFREG));
+static_assert (!S_ISOFL (S_IFCHR));
+static_assert (!S_ISOFL (S_IFDIR));
+static_assert (!S_ISOFL (S_IFIFO));
+static_assert (!S_ISOFL (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISOFL (S_IFLNK));
+static_assert (!S_ISOFL (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISOFL (S_IFSOCK));
+static_assert (!S_ISOFL (S_IFSOCK));
 #endif
 
 #ifdef S_IFBLK
-verify (!S_ISWHT (S_IFBLK));
+static_assert (!S_ISWHT (S_IFBLK));
 #endif
-verify (!S_ISWHT (S_IFCHR));
-verify (!S_ISWHT (S_IFDIR));
-verify (!S_ISWHT (S_IFIFO));
-verify (!S_ISWHT (S_IFREG));
+static_assert (!S_ISWHT (S_IFCHR));
+static_assert (!S_ISWHT (S_IFDIR));
+static_assert (!S_ISWHT (S_IFIFO));
+static_assert (!S_ISWHT (S_IFREG));
 #ifdef S_IFLNK
-verify (!S_ISWHT (S_IFLNK));
+static_assert (!S_ISWHT (S_IFLNK));
 #endif
 #ifdef S_IFSOCK
-verify (!S_ISWHT (S_IFSOCK));
+static_assert (!S_ISWHT (S_IFSOCK));
 #endif
 
 /* POSIX 2008 requires traditional encoding of permission constants.  */
-verify (S_IRWXU == 00700);
-verify (S_IRUSR == 00400);
-verify (S_IWUSR == 00200);
-verify (S_IXUSR == 00100);
-verify (S_IRWXG == 00070);
-verify (S_IRGRP == 00040);
-verify (S_IWGRP == 00020);
-verify (S_IXGRP == 00010);
-verify (S_IRWXO == 00007);
-verify (S_IROTH == 00004);
-verify (S_IWOTH == 00002);
-verify (S_IXOTH == 00001);
-verify (S_ISUID == 04000);
-verify (S_ISGID == 02000);
-verify (S_ISVTX == 01000);
+static_assert (S_IRWXU == 00700);
+static_assert (S_IRUSR == 00400);
+static_assert (S_IWUSR == 00200);
+static_assert (S_IXUSR == 00100);
+static_assert (S_IRWXG == 00070);
+static_assert (S_IRGRP == 00040);
+static_assert (S_IWGRP == 00020);
+static_assert (S_IXGRP == 00010);
+static_assert (S_IRWXO == 00007);
+static_assert (S_IROTH == 00004);
+static_assert (S_IWOTH == 00002);
+static_assert (S_IXOTH == 00001);
+static_assert (S_ISUID == 04000);
+static_assert (S_ISGID == 02000);
+static_assert (S_ISVTX == 01000);
 
 #if ((0 <= UTIME_NOW && UTIME_NOW < 1000000000)           \
      || (0 <= UTIME_OMIT && UTIME_OMIT < 1000000000)      \
diff --git a/tests/test-time.c b/tests/test-time.c
index 3c00a4ef04..6b69f3d529 100644
--- a/tests/test-time.c
+++ b/tests/test-time.c
@@ -20,8 +20,6 @@
 
 #include <time.h>
 
-#include "verify.h"
-
 /* Check that the types are all defined.  */
 struct timespec t1;
 #if 0
@@ -32,11 +30,11 @@ pid_t t2;
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that TIME_UTC is defined and a positive integer.  */
 int t3 = TIME_UTC;
-verify (TIME_UTC > 0);
+static_assert (TIME_UTC > 0);
 
 int
 main (void)
diff --git a/tests/test-uchar.c b/tests/test-uchar.c
index a2af51c523..ad83d8ad91 100644
--- a/tests/test-uchar.c
+++ b/tests/test-uchar.c
@@ -20,8 +20,6 @@
 
 #include <uchar.h>
 
-#include "verify.h"
-
 /* Check that the types are defined.  */
 mbstate_t a = { 0 };
 size_t b = 5;
@@ -29,19 +27,19 @@ char16_t c = 'x';
 char32_t d = 'y';
 
 /* Check that char16_t and char32_t are unsigned types.  */
-verify ((char16_t)(-1) >= 0);
+static_assert ((char16_t)(-1) >= 0);
 #if !defined __HP_cc
-verify ((char32_t)(-1) >= 0);
+static_assert ((char32_t)(-1) >= 0);
 #endif
 
 /* Check that char32_t is at least 31 bits wide.  */
-verify ((char32_t)0x7FFFFFFF != (char32_t)0x3FFFFFFF);
+static_assert ((char32_t)0x7FFFFFFF != (char32_t)0x3FFFFFFF);
 
 /* Check that _GL_LARGE_CHAR32_T is correctly defined.  */
 #if _GL_LARGE_CHAR32_T
-verify (sizeof (char32_t) > sizeof (wchar_t));
+static_assert (sizeof (char32_t) > sizeof (wchar_t));
 #else
-verify (sizeof (char32_t) == sizeof (wchar_t));
+static_assert (sizeof (char32_t) == sizeof (wchar_t));
 #endif
 
 int
diff --git a/tests/test-unistd.c b/tests/test-unistd.c
index 2c04b286ea..a59af1e3ff 100644
--- a/tests/test-unistd.c
+++ b/tests/test-unistd.c
@@ -20,11 +20,9 @@
 
 #include <unistd.h>
 
-#include "verify.h"
-
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 /* Check that the various SEEK_* macros are defined.  */
 int sk[] = { SEEK_CUR, SEEK_END, SEEK_SET };
diff --git a/tests/test-wchar.c b/tests/test-wchar.c
index 97c3bfb3b3..af7c948601 100644
--- a/tests/test-wchar.c
+++ b/tests/test-wchar.c
@@ -20,15 +20,13 @@
 
 #include <wchar.h>
 
-#include "verify.h"
-
 /* Check that the types wchar_t and wint_t are defined.  */
 wchar_t a = 'c';
 wint_t b = 'x';
 
 /* Check that NULL can be passed through varargs as a pointer type,
    per POSIX 2008.  */
-verify (sizeof NULL == sizeof (void *));
+static_assert (sizeof NULL == sizeof (void *));
 
 int
 main (void)
-- 
2.37.2


[-- Attachment #4: 0003-stdalign-alignas-and-alignof-are-C23-keywords.patch --]
[-- Type: text/x-patch, Size: 9605 bytes --]

From 0804812cc2c659802fb8c070ab4f64957eb4e26c Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 13 Sep 2022 17:29:36 -0500
Subject: [PATCH 3/4] stdalign: alignas and alignof are C23 keywords
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* m4/stdalign.m4 (gl_STDALIGN_H): Check also whether
alignas and alignof are keywords and so don’t need stdalign.h,
and define HAVE_C_ALIGNASOF if so.
If not, arrange for config.h to #define alignas and alignof
by including <stdalign.h>.
* modules/stdalign: No need to include <stdalign.h>.
* tests/test-stdalign.c: Do not include stdalign.h.
---
 ChangeLog                       |  9 +++++++
 doc/gnulib.texi                 | 25 +++++++++++++++++++
 doc/posix-headers/stdalign.texi | 35 ++++++++++++++++-----------
 m4/stdalign.m4                  | 43 ++++++++++++++++++++++++---------
 modules/stdalign                |  3 +--
 tests/test-stdalign.c           |  2 --
 6 files changed, 87 insertions(+), 30 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 7c1b0afadd..e05f581282 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,15 @@
 
 2022-09-13  Paul Eggert  <eggert@cs.ucla.edu>
 
+	stdalign: alignas and alignof are C23 keywords
+	* m4/stdalign.m4 (gl_STDALIGN_H): Check also whether
+	alignas and alignof are keywords and so don’t need stdalign.h,
+	and define HAVE_C_ALIGNASOF if so.
+	If not, arrange for config.h to #define alignas and alignof
+	by including <stdalign.h>.
+	* modules/stdalign: No need to include <stdalign.h>.
+	* tests/test-stdalign.c: Do not include stdalign.h.
+
 	assert-h: prefer to ‘verify’
 	Where it’s easy, prefer ‘static_assert’ to ‘verify’,
 	as this simplifies the source by removing the need to
diff --git a/doc/gnulib.texi b/doc/gnulib.texi
index 1bef2a0975..e1debc9742 100644
--- a/doc/gnulib.texi
+++ b/doc/gnulib.texi
@@ -865,10 +865,35 @@ This chapter describes which keywords specified by ISO C are
 substituted by Gnulib.
 
 @menu
+* alignof::        @code{alignas} and @code{alignof}
 * bool::           @code{bool}, @code{false}, and @code{true}
 * static_assert::  @code{static_assert}
 @end menu
 
+@node alignof
+@section @code{alignof} and @code{alignas}
+
+Gnulib module: stdalign
+
+The @code{stdalign} module arranges for @code{alignas}, @code{alignof}, and
+@code{<stdalign.h>} to be more like standard C@.  @xref{stdalign.h}.
+
+Portability problems fixed by Gnulib:
+@itemize
+@item
+Pre-C11 platforms lack @code{alignas} and @code{alignof}.
+
+@item
+On pre-C23 platforms, @code{<stdalign.h>} must be included before
+using @code{alignas} or @code{alignof}.
+@end itemize
+
+Portability problems not fixed by Gnulib:
+@itemize
+@item
+On pre-C23 platforms, @code{alignas} and @code{alignof} are macros.
+@end itemize
+
 @node bool
 @section @code{bool}
 
diff --git a/doc/posix-headers/stdalign.texi b/doc/posix-headers/stdalign.texi
index 4ed83bec3e..be3cec80d1 100644
--- a/doc/posix-headers/stdalign.texi
+++ b/doc/posix-headers/stdalign.texi
@@ -14,50 +14,57 @@ Gnulib module: stdalign
 Portability problems fixed by Gnulib:
 @itemize
 @item
+On older C platforms @code{<stdalign.h>} must be included before using
+@code{alignas} or @code{alignof}.  For example, GCC versions before 13 do not
+support these keywords, which were standardized by C23.
+@item
 This header file is missing on many platforms:
 FreeBSD 6.4, NetBSD 7.1, OpenBSD 6.7, Minix 3.3.0, AIX 7.1, HP-UX 11.31, IRIX 6.5, Solaris 11.3, mingw, MSVC 14, Android 9.0.
 @item
-Clang 3.0's @code{<stdalign.h>} does not define @code{alignof}/@code{_Alignof}.
+Clang 3.0's @code{<stdalign.h>} does not define @code{alignof}.
 @item
-The @code{alignof} and @code{_Alignof} macros return too large values for
+The @code{alignof} macro returns too large values for
 the types @code{double} and @code{long long} in GCC 4.7.0.
+@item
+Older C platforms might not support the obsolescent
+@code{_Alignas} and @code{_Alignof} keywords or macros.
+This portability problem should not matter with code using this module,
+as such code should use @code{alignas} and @code{alignof} instead.
 @end itemize
 
 Portability problems not fixed by Gnulib:
 @itemize
 @item
-In ISO C11, the operand of @code{alignof}/@code{_Alignof} must be a
+In C11 and later, the operand of @code{alignof} must be a
 parenthesized type.  Recent versions of GCC support an extension in
 which the operand can also be a unary expression, as with
 @code{sizeof}.  The Gnulib substitute does not support this extension.
 @item
 On most pre-C11 platforms, the operand of
-@code{alignof}/@code{_Alignof} cannot be a structure type containing a
+@code{alignof} cannot be a structure type containing a
 flexible array member.
 @item
-@code{_Alignas} and @code{alignas} are not always supported.
+The @code{alignas} keyword or macro is not always supported.
 Supported compilers include any compiler supporting C11 or later,
 which includes GCC, IBM C, Sun C 5.9 and later,
 and MSVC 7.0 and later.
 @item
 Some compilers do not support alignment via
-@code{alignas}/@code{_Alignas} of @code{auto} variables (i.e.,
+@code{alignas} of @code{auto} variables (i.e.,
 variables on the stack).  They diagnose and ignore the alignment: Sun
 C 5.11.
 @item
-Some linkers do not support operands of @code{_Alignas}/@code{alignas}
+Some linkers do not support operands of @code{alignas}
 that are greater than 8: mingw.
 @item
-Some compilers require the operand of @code{_Alignas}/@code{alignas}
+Some compilers require the operand of @code{alignas}
 to be a single integer constant, not an expression: MSVC 7.0 through
 at least 10.0.
 @item
-The Sun C 5.13 compiler sometimes mishandles the alignment of multiple
+The Sun C 5.13 (2014) compiler sometimes mishandles the alignment of multiple
 external variables that are declared close together with
-@code{_Alignas}/@code{alignas}.  The Sun Studio Developer Bug
-Report Review Team assigned the internal review ID 2125432 (dated
-2011-11-01) to this issue.  The bug appears to be fixed in Sun C 5.15,
-also known as Oracle Developer Studio 12.6.
+@code{alignas}.  The bug is fixed in Sun C 5.15, also known as Oracle
+Developer Studio 12.6 (2017).
 @item
 @code{<stdalign.h>} must be #included before @code{_Alignas} and
 @code{_Alignof} can be used.
@@ -67,6 +74,6 @@ In C11 and C17, @code{<stdalign.h>} defines the macros
 @code{__alignof_is_defined} to 1.
 In C23, these macros are not defined.
 @item
-You cannot assume that @code{_Alignas} and @code{_Alignof} are reserved words;
+You cannot assume that @code{alignas} and @code{alignof} are reserved words;
 they might be macros.
 @end itemize
diff --git a/m4/stdalign.m4 b/m4/stdalign.m4
index c3283760d5..9164c2f357 100644
--- a/m4/stdalign.m4
+++ b/m4/stdalign.m4
@@ -1,4 +1,4 @@
-# Check for stdalign.h that conforms to C11.
+# Check for alignas and alignof that conform to C23.
 
 dnl Copyright 2011-2022 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
@@ -9,12 +9,18 @@ dnl with or without modifications, as long as this notice is preserved.
 
 AC_DEFUN([gl_STDALIGN_H],
 [
-  AC_CACHE_CHECK([for working stdalign.h],
+  AC_CACHE_CHECK([for alignas and alignof],
     [gl_cv_header_working_stdalign_h],
-    [AC_COMPILE_IFELSE(
+    [gl_save_CFLAGS=$CFLAGS
+     for gl_working in "yes, keywords" "yes, <stdalign.h> macros"; do
+      AS_CASE([$gl_working],
+        [*stdalign.h*], [CFLAGS="$gl_save_CFLAGS -DINCLUDE_STDALIGN_H"])
+      AC_COMPILE_IFELSE(
        [AC_LANG_PROGRAM(
           [[#include <stdint.h>
-            #include <stdalign.h>
+            #ifdef INCLUDE_STDALIGN_H
+             #include <stdalign.h>
+            #endif
             #include <stddef.h>
 
             /* Test that alignof yields a result consistent with offsetof.
@@ -45,12 +51,25 @@ AC_DEFUN([gl_STDALIGN_H],
                                 ? 1 : -1];
             #endif
           ]])],
-       [gl_cv_header_working_stdalign_h=yes],
-       [gl_cv_header_working_stdalign_h=no])])
-
-  if test $gl_cv_header_working_stdalign_h = yes; then
-    GL_GENERATE_STDALIGN_H=false
-  else
-    GL_GENERATE_STDALIGN_H=true
-  fi
+       [gl_cv_header_working_stdalign_h=$gl_working],
+       [gl_cv_header_working_stdalign_h=no])
+
+      CFLAGS=$gl_save_CFLAGS
+      test "$gl_cv_header_working_stdalign_h" != no && break
+     done])
+
+  GL_GENERATE_STDALIGN_H=false
+  AS_CASE([$gl_cv_header_working_stdalign_h],
+    [no],
+      [GL_GENERATE_STDALIGN_H=true],
+    [yes*keyword*],
+      [AC_DEFINE([HAVE_C_ALIGNASOF], [1],
+         [Define to 1 if the alignas and alignof keywords work.])])
+
+  dnl The "zz" puts this toward config.h's end, to avoid potential
+  dnl collisions with other definitions.
+  AH_VERBATIM([zzalignas],
+[#if !defined HAVE_C_ALIGNASOF && __cplusplus < 201103 && !defined alignof
+ #include <stdalign.h>
+#endif])
 ])
diff --git a/modules/stdalign b/modules/stdalign
index 24c79ec493..af038180fa 100644
--- a/modules/stdalign
+++ b/modules/stdalign
@@ -1,5 +1,5 @@
 Description:
-A <stdalign.h> that nearly conforms to ISO C11 and C++11.
+alignas and alignof that are like C23 and C++11.
 
 Files:
 lib/stdalign.in.h
@@ -30,7 +30,6 @@ endif
 MOSTLYCLEANFILES += stdalign.h stdalign.h-t
 
 Include:
-<stdalign.h>
 
 License:
 LGPLv2+
diff --git a/tests/test-stdalign.c b/tests/test-stdalign.c
index ea07543802..a935554563 100644
--- a/tests/test-stdalign.c
+++ b/tests/test-stdalign.c
@@ -18,8 +18,6 @@
 
 #include <config.h>
 
-#include <stdalign.h>
-
 #include <stddef.h>
 #include <stdint.h>
 
-- 
2.37.2


[-- Attachment #5: 0004-stdalign-prefer-to-not-include-stdalign.h.patch --]
[-- Type: text/x-patch, Size: 4452 bytes --]

From b098a986b8013a3b2dba395240d77886404ebaf7 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 13 Sep 2022 17:29:36 -0500
Subject: [PATCH 4/4] stdalign: prefer to not include <stdalign.h>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lib/alignalloc.c, lib/argp-parse.c, lib/fts.c, lib/md4.c, lib/md5.c:
* lib/rawmemchr.c, lib/sha1.c, lib/sha256.c, lib/sha512.c, lib/sm3.c:
* lib/sys_socket.in.h:
In C23, <stdalign.h> is a no-op, so don’t include it.
---
 ChangeLog           | 6 ++++++
 lib/alignalloc.c    | 1 -
 lib/argp-parse.c    | 1 -
 lib/fts.c           | 1 -
 lib/md4.c           | 1 -
 lib/md5.c           | 1 -
 lib/rawmemchr.c     | 1 -
 lib/sha1.c          | 1 -
 lib/sha256.c        | 1 -
 lib/sha512.c        | 1 -
 lib/sm3.c           | 1 -
 lib/sys_socket.in.h | 1 -
 12 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e05f581282..3e291ebf8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,12 @@
 
 2022-09-13  Paul Eggert  <eggert@cs.ucla.edu>
 
+	stdalign: prefer to not include <stdalign.h>
+	* lib/alignalloc.c, lib/argp-parse.c, lib/fts.c, lib/md4.c, lib/md5.c:
+	* lib/rawmemchr.c, lib/sha1.c, lib/sha256.c, lib/sha512.c, lib/sm3.c:
+	* lib/sys_socket.in.h:
+	In C23, <stdalign.h> is a no-op, so don’t include it.
+
 	stdalign: alignas and alignof are C23 keywords
 	* m4/stdalign.m4 (gl_STDALIGN_H): Check also whether
 	alignas and alignof are keywords and so don’t need stdalign.h,
diff --git a/lib/alignalloc.c b/lib/alignalloc.c
index 1be5d4d2ba..d5922e16ac 100644
--- a/lib/alignalloc.c
+++ b/lib/alignalloc.c
@@ -23,7 +23,6 @@
 #include "alignalloc.h"
 
 #include <limits.h>
-#include <stdalign.h>
 #include <stdckdint.h>
 #include <stdint.h>
 
diff --git a/lib/argp-parse.c b/lib/argp-parse.c
index 90b2c9b146..9bd422ca7b 100644
--- a/lib/argp-parse.c
+++ b/lib/argp-parse.c
@@ -21,7 +21,6 @@
 #endif
 
 #include <alloca.h>
-#include <stdalign.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/fts.c b/lib/fts.c
index 7778b6b786..954cbb7b40 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -62,7 +62,6 @@ static char sccsid[] = "@(#)fts.c       8.6 (Berkeley) 8/14/94";
 #endif
 #include <fcntl.h>
 #include <errno.h>
-#include <stdalign.h>
 #include <stddef.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/lib/md4.c b/lib/md4.c
index 9355f186d7..aebd39c6c4 100644
--- a/lib/md4.c
+++ b/lib/md4.c
@@ -24,7 +24,6 @@
 /* Specification.  */
 #include "md4.h"
 
-#include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
 #include <sys/types.h>
diff --git a/lib/md5.c b/lib/md5.c
index 57489ed74c..c16ac4a93a 100644
--- a/lib/md5.c
+++ b/lib/md5.c
@@ -27,7 +27,6 @@
 #endif
 #include "md5.h"
 
-#include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
 #include <sys/types.h>
diff --git a/lib/rawmemchr.c b/lib/rawmemchr.c
index c789599db8..bdd7307de4 100644
--- a/lib/rawmemchr.c
+++ b/lib/rawmemchr.c
@@ -23,7 +23,6 @@
 #if !HAVE_RAWMEMCHR
 
 # include <limits.h>
-# include <stdalign.h>
 # include <stdint.h>
 
 
diff --git a/lib/sha1.c b/lib/sha1.c
index 79e50ba0b0..5a18213edc 100644
--- a/lib/sha1.c
+++ b/lib/sha1.c
@@ -29,7 +29,6 @@
 #endif
 #include "sha1.h"
 
-#include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
 
diff --git a/lib/sha256.c b/lib/sha256.c
index c9ca618c67..60cd763612 100644
--- a/lib/sha256.c
+++ b/lib/sha256.c
@@ -28,7 +28,6 @@
 #endif
 #include "sha256.h"
 
-#include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
 
diff --git a/lib/sha512.c b/lib/sha512.c
index 6776bb464d..fd17a7dc76 100644
--- a/lib/sha512.c
+++ b/lib/sha512.c
@@ -28,7 +28,6 @@
 #endif
 #include "sha512.h"
 
-#include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
 
diff --git a/lib/sm3.c b/lib/sm3.c
index 5594945315..a7402906b1 100644
--- a/lib/sm3.c
+++ b/lib/sm3.c
@@ -31,7 +31,6 @@
 #endif
 #include "sm3.h"
 
-#include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
 
diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h
index acdf7eee50..637a248d15 100644
--- a/lib/sys_socket.in.h
+++ b/lib/sys_socket.in.h
@@ -97,7 +97,6 @@ typedef unsigned char   sa_family_t;
 #  endif
 # endif
 #else
-# include <stdalign.h>
 /* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
    2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
 # define __ss_aligntype unsigned long int
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-13  3:32 ` [PROPOSED 2/2] assert-h: prefer to ‘verify’ Paul Eggert
@ 2022-09-14  1:05   ` Bruno Haible
  2022-09-14  4:47     ` Paul Eggert
  2022-09-14 11:35   ` Bruno Haible
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 13+ messages in thread
From: Bruno Haible @ 2022-09-14  1:05 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

Paul Eggert wrote:
> Where it’s easy, prefer ‘static_assert’ to ‘verify’,

Compiling a current GNU gettext with these patches on Cygwin and mingw
I get a compilation error:

/bin/sh ./libtool  --tag=CXX   --mode=compile x86_64-pc-cygwin-g++ -DIN_LIBASPRINTF -DHAVE_CONFIG_H -D__USE_MINGW_ANSI_STDIO=0 -I. -I../../../gettext-runtime/libasprintf  -Ignulib-lib -I../../../gettext-runtime/libasprintf/gnulib-lib -I/usr/local/cygwin64/include -Wall  -g -O2 -c -o autosprintf.lo ../../../gettext-runtime/libasprintf/autosprintf.cc
libtool: compile:  x86_64-pc-cygwin-g++ -DIN_LIBASPRINTF -DHAVE_CONFIG_H -D__USE_MINGW_ANSI_STDIO=0 -I. -I../../../gettext-runtime/libasprintf -Ignulib-lib -I../../../gettext-runtime/libasprintf/gnulib-lib -I/usr/local/cygwin64/include -Wall -g -O2 -c ../../../gettext-runtime/libasprintf/autosprintf.cc -o autosprintf.o
In file included from ./config.h:1097:0,
                 from ../../../gettext-runtime/libasprintf/autosprintf.cc:18:
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/type_traits:1105:7: error: expected identifier before 'sizeof'
       static_assert(sizeof...(_Args) > 1,
       ^
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/type_traits:1105:7: error: expected ',' or '...' before 'sizeof'
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/type_traits:2093:7: error: expected identifier before 'sizeof'
       static_assert(sizeof...(_Types) != 0, "At least one type is required");
       ^
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/type_traits:2093:7: error: expected ',' or '...' before 'sizeof'
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/bits/ptr_traits.h:114:7: error: expected identifier before '!' token
       static_assert(!is_same<element_type, __undefined>::value,
       ^
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/bits/ptr_traits.h:114:7: error: expected ',' or '...' before '!' token
In file included from /usr/include/features.h:12:0,
                 from gnulib-lib/wchar.h:66,
                 from /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/cwchar:44,
                 from /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/bits/postypes.h:40,
                 from /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/bits/char_traits.h:40,
                 from /usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/string:40,
                 from ./autosprintf.h:35,
                 from ../../../gettext-runtime/libasprintf/autosprintf.cc:21:
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/utility:309:7: error: '_Num' is not a type
       static_assert( _Num >= 0,
       ^
/usr/lib/gcc/x86_64-pc-cygwin/6.4.0/include/c++/utility:309:7: error: expected ',' or '...' before '>=' token
       static_assert( _Num >= 0,
       ^
make[6]: *** [Makefile:1412: autosprintf.lo] Error 1

This patch fixes it.


2022-09-13  Bruno Haible  <bruno@clisp.org>

	verify: Avoid syntax error due to static_assert with GNU C++ 6.x.
	* lib/verify.h (static_assert): Don't define in GNU C++ 6 or newer.

diff --git a/lib/verify.h b/lib/verify.h
index 0066d211b2..154a5b76bf 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -227,7 +227,8 @@ template <int w>
      _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
 # endif
 # if (!defined static_assert \
-      && __STDC_VERSION__ < 202311 && __cpp_static_assert < 201411)
+      && __STDC_VERSION__ < 202311 \
+      && __cpp_static_assert < 201411 && __GNUG__ < 6)
 #  define static_assert _Static_assert /* C11 requires this #define.  */
 # endif
 #endif





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-14  1:05   ` Bruno Haible
@ 2022-09-14  4:47     ` Paul Eggert
  2022-09-14  6:04       ` Bruno Haible
  0 siblings, 1 reply; 13+ messages in thread
From: Paul Eggert @ 2022-09-14  4:47 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 412 bytes --]

On 9/13/22 20:05, Bruno Haible wrote:
>   # if (!defined static_assert \
> -      && __STDC_VERSION__ < 202311 && __cpp_static_assert < 201411)
> +      && __STDC_VERSION__ < 202311 \
> +      && __cpp_static_assert < 201411 && __GNUG__ < 6)
>   #  define static_assert _Static_assert /* C11 requires this #define.  */
>   # endif

Thanks for the fix. Should I also install the attached patch, for 
consistency?

[-- Attachment #2: 0001-verify-treat-GNU-C-6-like-recent-C.patch --]
[-- Type: text/x-patch, Size: 1499 bytes --]

From e993a048cf8c58755da7c3b358cadf2f598bbff3 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 13 Sep 2022 23:01:53 -0500
Subject: [PATCH] verify: treat GNU C++ 6 like recent C++

* lib/verify.h (_GL_VERIFY):
* m4/assert_h.m4 (gl_ASSERT_H):
If we check __cpp_static_assert < 200410, also check __GNUG__ < 6,
for consistency with the previous change.
---
 ChangeLog      | 7 +++++++
 m4/assert_h.m4 | 3 ++-
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index 81183fa619..2e04ffd8d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2022-09-13  Paul Eggert  <eggert@cs.ucla.edu>
+
+	verify: treat GNU C++ 6 like recent C++
+	* m4/assert_h.m4 (gl_ASSERT_H):
+	If we check __cpp_static_assert < 201411, also check __GNUG__ < 6,
+	for consistency with the previous change.
+
 2022-09-13  Bruno Haible  <bruno@clisp.org>
 
 	verify: Avoid syntax error due to static_assert with GNU C++ 6.x.
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
index 36b3c78c91..ec756a970b 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -47,7 +47,8 @@ AC_DEFUN([gl_ASSERT_H],
   dnl including assert.h.  Break the #undef apart with a comment
   dnl so that 'configure' does not comment it out.
   AH_VERBATIM([zzstatic_assert],
-[#if !defined HAVE_C_STATIC_ASSERT && __cpp_static_assert < 201411
+[#if (!defined HAVE_C_STATIC_ASSERT \
+     && __cpp_static_assert < 201411 && __GNUG__ < 6)
  #include <assert.h>
  #undef/**/assert
 #endif])
-- 
2.37.2


^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-14  4:47     ` Paul Eggert
@ 2022-09-14  6:04       ` Bruno Haible
  0 siblings, 0 replies; 13+ messages in thread
From: Bruno Haible @ 2022-09-14  6:04 UTC (permalink / raw)
  To: Paul Eggert; +Cc: bug-gnulib

Paul Eggert wrote:
> >   # if (!defined static_assert \
> > -      && __STDC_VERSION__ < 202311 && __cpp_static_assert < 201411)
> > +      && __STDC_VERSION__ < 202311 \
> > +      && __cpp_static_assert < 201411 && __GNUG__ < 6)
> >   #  define static_assert _Static_assert /* C11 requires this #define.  */
> >   # endif
> 
> Thanks for the fix. Should I also install the attached patch, for 
> consistency?

Yes, please. Since the only purpose of the
 #include <assert.h>
 #undef/**/assert
here is to get 'static_assert' working, and it works already in g++ ≥ 6,
the patch is correct.

Bruno





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-13  3:32 ` [PROPOSED 2/2] assert-h: prefer to ‘verify’ Paul Eggert
  2022-09-14  1:05   ` Bruno Haible
@ 2022-09-14 11:35   ` Bruno Haible
  2022-12-28 22:41     ` Paul Eggert
  2022-09-14 13:43   ` Bruno Haible
  2022-09-14 20:22   ` Bruno Haible
  3 siblings, 1 reply; 13+ messages in thread
From: Bruno Haible @ 2022-09-14 11:35 UTC (permalink / raw)
  To: bug-gnulib; +Cc: Paul Eggert

Paul Eggert wrote:
> Where it’s easy, prefer ‘static_assert’ to ‘verify’,

On MSVC 14, in C mode, I get compilation errors:

...\gnulib-tests\test-assert.c(27): warning C4116: unnamed type definition in parentheses
...\gnulib-tests\test-assert.c(27): error C2057: expected constant expression
...\gnulib-tests\test-assert.c(27): error C2149: '_gl_static_assert_error_if_negative': named bit field cannot have zero width
...\gnulib-tests\test-assert.c(43): warning C4116: unnamed type definition in parentheses
...\gnulib-tests\test-assert.c(43): error C2057: expected constant expression
...\gnulib-tests\test-assert.c(43): error C2149: '_gl_static_assert_error_if_negative': named bit field cannot have zero width
...\gnulib-tests\test-assert.c(55): warning C4116: unnamed type definition in parentheses
...\gnulib-tests\test-assert.c(55): error C2057: expected constant expression
...\gnulib-tests\test-assert.c(55): error C2149: '_gl_static_assert_error_if_negative': named bit field cannot have zero width
...\gnulib-tests\test-assert.c(67): warning C4116: unnamed type definition in parentheses
...\gnulib-tests\test-assert.c(67): error C2057: expected constant expression
...\gnulib-tests\test-assert.c(67): error C2149: '_gl_static_assert_error_if_negative': named bit field cannot have zero width
make[3]: *** [Makefile:7324: test-assert.obj] Error 2

How come? These lines from the test program

  static_assert (2 + 2 == 4, "arithmetic does not work");
  static_assert (2 + 2 == 4);
  static_assert (sizeof (char) == 1, "sizeof does not work");
  static_assert (sizeof (char) == 1);

macroexpand to

  extern int (*_gl_static_assert_function2 (void)) [(!!sizeof (struct { unsigned int _gl_static_assert_error_if_negative: (2 + 2 == 4, "arithmetic does not work") ? 1 : -1; }))];
  extern int (*_gl_static_assert_function3 (void)) [(!!sizeof (struct { unsigned int _gl_static_assert_error_if_negative: (2 + 2 == 4) ? 1 : -1; }))];
  extern int (*_gl_static_assert_function4 (void)) [(!!sizeof (struct { unsigned int _gl_static_assert_error_if_negative: (sizeof (char) == 1, "sizeof does not work") ? 1 : -1; }))];
  extern int (*_gl_static_assert_function5 (void)) [(!!sizeof (struct { unsigned int _gl_static_assert_error_if_negative: (sizeof (char) == 1) ? 1 : -1; }))];

which obviously is nonsense, as the value of a comma expression is the last
part, not the first part.

This patch fixes it.


2022-09-14  Bruno Haible  <bruno@clisp.org>

	verify: Avoid syntax error due to static_assert with MSVC 14.
	* lib/verify.h (_Static_assert): Pass only the first argument to
	_GL_VERIFY.

diff --git a/lib/verify.h b/lib/verify.h
index 154a5b76bf..a0d597f3d4 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -223,8 +223,8 @@ template <int w>
 /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h.  */
 #ifdef _GL_STATIC_ASSERT_H
 # if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
-#  define _Static_assert(...) \
-     _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+#  define _Static_assert(R, ...) \
+     _GL_VERIFY ((R), "static assertion failed", -)
 # endif
 # if (!defined static_assert \
       && __STDC_VERSION__ < 202311 \





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-13  3:32 ` [PROPOSED 2/2] assert-h: prefer to ‘verify’ Paul Eggert
  2022-09-14  1:05   ` Bruno Haible
  2022-09-14 11:35   ` Bruno Haible
@ 2022-09-14 13:43   ` Bruno Haible
  2022-09-14 16:10     ` Bruno Haible
  2022-09-14 20:22   ` Bruno Haible
  3 siblings, 1 reply; 13+ messages in thread
From: Bruno Haible @ 2022-09-14 13:43 UTC (permalink / raw)
  To: bug-gnulib, Paul Eggert

Paul Eggert wrote:
> Where it’s easy, prefer ‘static_assert’ to ‘verify’,

Compiling a current GNU gettext with MSVC 14, I get this compilation error:

libtool: compile:  /home/bruno/msvc/compile cl -nologo -DIN_LIBASPRINTF -DHAVE_CONFIG_H -D__USE_MINGW_ANSI_STDIO=0 -I. -I../../../gettext-runtime/libasprintf -Ignulib-lib -I../../../gettext-runtime/libasprintf/gnulib-lib -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -I/usr/local/msvc64/include -MD -c ../../../gettext-runtime/libasprintf/autosprintf.cc -o autosprintf.obj
autosprintf.cc
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstddef(376): error C2720: 'std::hash<_Kty>::_gl_static_assert_function3': 'extern' storage-class specifier illegal on members
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xstddef(378): note: see reference to class template instantiation 'std::hash<_Kty>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(744): error C2720: 'std::_Change_sign<_Ty>::_gl_static_assert_function4': 'extern' storage-class specifier illegal on members
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(777): note: see reference to class template instantiation 'std::_Change_sign<_Ty>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(1193): error C2720: 'std::integer_sequence<_Ty,_Vals...>::_gl_static_assert_function5': 'extern' storage-class specifier illegal on members
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(1203): note: see reference to class template instantiation 'std::integer_sequence<_Ty,_Vals...>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(1502): error C2720: 'std::result_of<_Fty>::_gl_static_assert_function7': 'extern' storage-class specifier illegal on members
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(1505): note: see reference to class template instantiation 'std::result_of<_Fty>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(1580): error C2720: 'std::reference_wrapper<_Ty>::_gl_static_assert_function8': 'extern' storage-class specifier illegal on members
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\type_traits(1612): note: see reference to class template instantiation 'std::reference_wrapper<_Ty>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(423): error C2720: 'std::tuple_element<_Idx,std::array<_Ty,_Size>>::_gl_static_assert_function9': 'extern' storage-class specifier illegal on members
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(426): note: see reference to class template instantiation 'std::tuple_element<_Idx,std::array<_Ty,_Size>>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(445): error C2059: syntax error: ')'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(447): note: see reference to class template instantiation 'std::tuple_element<_Index,std::tuple<>>' being compiled
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(445): error C2947: expecting '>' to terminate template-argument-list, found '>'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(445): error C2976: 'std::integral_constant': too few template arguments
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xtr1common(23): note: see declaration of 'std::integral_constant'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(447): error C2143: syntax error: missing ';' before '}'
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\utility(447): fatal error C1004: unexpected end-of-file found
make[4]: *** [Makefile:1412: autosprintf.lo] Error 1

The situation with this compiler (in C++ mode) is:
  - It supports 'static_assert' with 2 arguments.
  - It does not support 'static_assert' with 1 argument.
  - Its header files make use of the 'static_assert' with 2 arguments,
    for example:

	template<size_t _Index>
	struct tuple_element<_Index, tuple<> >
	{	// enforce bounds checking
	static_assert(_Always_false<integral_constant<size_t, _Index> >::value,
		"tuple index out of bounds");
	};

Thus, our existing definition of static_assert via _Static_assert an _GL_VERIFY
does not work, because 'extern' is not allowed inside a struct/class definition.

This attempted patch

diff --git a/lib/verify.h b/lib/verify.h
index a0d597f3d4..608c9bda20 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -229,7 +229,13 @@ template <int w>
 # if (!defined static_assert \
       && __STDC_VERSION__ < 202311 \
       && __cpp_static_assert < 201411 && __GNUG__ < 6)
-#  define static_assert _Static_assert /* C11 requires this #define.  */
+#  if defined __cplusplus && _MSC_VER >= 1900
+/* MSVC 14 in C++ mode supports the 2-arguments static_assert but not the
+   one-argument static_assert, and it does not support _Static_assert.  */
+#   define static_assert(R, ...) static_assert((R), "static assertion failed")
+#  else
+#   define static_assert _Static_assert /* C11 requires this #define.  */
+#  endif
 # endif
 #endif
 
does not work either, because when we define static_assert as a macro, it
parses

static_assert(_Always_false<integral_constant<size_t, _Index> >::value,
		"tuple index out of bounds");

as a macro call with 3 arguments:
  argument 1:   _Always_false<integral_constant<size_t
  argument 2:   _Index> >::value
  argument 3:   "tuple index out of bounds"

Any ideas how to get this working?

Bruno





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-14 13:43   ` Bruno Haible
@ 2022-09-14 16:10     ` Bruno Haible
  0 siblings, 0 replies; 13+ messages in thread
From: Bruno Haible @ 2022-09-14 16:10 UTC (permalink / raw)
  To: bug-gnulib, Paul Eggert

> > Where it’s easy, prefer ‘static_assert’ to ‘verify’,
> 
> Compiling a current GNU gettext with MSVC 14, I get this compilation error:

I got this working, by using preprocessor tricks, inspired by
  <https://github.com/Hirrolot/awesome-c-preprocessor>
  <https://stackoverflow.com/questions/11761703/>
  <https://groups.google.com/g/comp.std.c/c/d-6Mj5Lko_s?pli=1>
  <https://stackoverflow.com/questions/5134523/>


2022-09-14  Bruno Haible  <bruno@clisp.org>

	verify: Avoid syntax error due to static_assert with MSVC 14 in C++.
	* lib/verify.h (static_assert): For MSVC in C++ mode, use a definition
	that supports both the two-arguments and the one-argument syntax.

diff --git a/lib/verify.h b/lib/verify.h
index a0d597f3d4..0f5f0edc86 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -229,7 +229,22 @@ template <int w>
 # if (!defined static_assert \
       && __STDC_VERSION__ < 202311 \
       && __cpp_static_assert < 201411 && __GNUG__ < 6)
-#  define static_assert _Static_assert /* C11 requires this #define.  */
+#  if defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
+/* MSVC 14 in C++ mode supports the two-arguments static_assert but not
+   the one-argument static_assert, and it does not support _Static_assert.
+   We have to play preprocessor tricks to distinguish the two cases.
+   Since the MSVC preprocessor is not ISO C compliant (cf.
+   <https://stackoverflow.com/questions/5134523/>), the solution is specific
+   to MSVC.  */
+#   define _GL_EXPAND(x) x
+#   define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
+#   define _GL_SA2 static_assert
+#   define _GL_SA3 static_assert
+#   define _GL_SA_PICK(x1,x2,x3,x4,...) x4
+#   define static_assert(...) _GL_EXPAND(_GL_SA_PICK(__VA_ARGS__,_GL_SA3,_GL_SA2,_GL_SA1)) (__VA_ARGS__)
+#  else
+#   define static_assert _Static_assert /* C11 requires this #define. */
+#  endif
 # endif
 #endif
 





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-13  3:32 ` [PROPOSED 2/2] assert-h: prefer to ‘verify’ Paul Eggert
                     ` (2 preceding siblings ...)
  2022-09-14 13:43   ` Bruno Haible
@ 2022-09-14 20:22   ` Bruno Haible
  3 siblings, 0 replies; 13+ messages in thread
From: Bruno Haible @ 2022-09-14 20:22 UTC (permalink / raw)
  To: bug-gnulib, Paul Eggert

Paul Eggert wrote:
> Where it’s easy, prefer ‘static_assert’ to ‘verify’,

In a build of GNU gettext, with clang and the MSVC header files, I get errors
starting like this:

/bin/sh ./libtool  --tag=CXX   --mode=compile /home/bruno/msvc/compile clang-cl -ferror-limit=0 -DIN_LIBASPRINTF -DHAVE_CONFIG_H -D__USE_MINGW_ANSI_STDIO=0 -I. -I../../../gettext-runtime/libasprintf  -Ignulib-lib -I../../../gettext-runtime/libasprintf/gnulib-lib -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -I/usr/local/msvcclang64/include -Wall -Wno-extra-semi-stmt -Wno-unused-function -Wno-inconsistent-dllimport -Wno-reserved-id-macro -Wno-undef -Wno-missing-field-initializers -Wno-unused-parameter -Wno-gnu-include-next -Wno-implicit-int-conversion -Wno-sign-compare -Wno-sign-conversion -Wno-comma -Wno-unused-macros -Wno-nonportable-system-include-path -Wno-format-nonliteral -Wno-deprecated-declarations -Wno-tautological-unsigned-zero-compare -Wno-used-but-marked-unused -Wno-parentheses-equality  -MD -O2 -c -o autosprintf.lo ../../../gettext-runtime/libasprintf/autosprintf.cc
libtool: compile:  /home/bruno/msvc/compile clang-cl -ferror-limit=0 -DIN_LIBASPRINTF -DHAVE_CONFIG_H -D__USE_MINGW_ANSI_STDIO=0 -I. -I../../../gettext-runtime/libasprintf -Ignulib-lib -I../../../gettext-runtime/libasprintf/gnulib-lib -D_WIN32_WINNT=_WIN32_WINNT_WIN7 -I/usr/local/msvcclang64/include -Wall -Wno-extra-semi-stmt -Wno-unused-function -Wno-inconsistent-dllimport -Wno-reserved-id-macro -Wno-undef -Wno-missing-field-initializers -Wno-unused-parameter -Wno-gnu-include-next -Wno-implicit-int-conversion -Wno-sign-compare -Wno-sign-conversion -Wno-comma -Wno-unused-macros -Wno-nonportable-system-include-path -Wno-format-nonliteral -Wno-deprecated-declarations -Wno-tautological-unsigned-zero-compare -Wno-used-but-marked-unused -Wno-parentheses-equality -MD -O2 -c ../../../gettext-runtime/libasprintf/autosprintf.cc -o autosprintf.obj
In file included from ../../../gettext-runtime/libasprintf/autosprintf.cc:18:
In file included from .\config.h:1098:
gnulib-lib\assert.h(239,43): warning: variadic macros are incompatible with C++98 [-Wc++98-compat-pedantic]
# define _GL_STATIC_ASSERT(R, DIAGNOSTIC, ...) static_assert (R, DIAGNOSTIC)
                                          ^
gnulib-lib\assert.h(254,29): warning: variadic macros are incompatible with C++98 [-Wc++98-compat-pedantic]
#  define _Static_assert(R, ...) \
                            ^
gnulib-lib\assert.h(274,12): warning: keyword is hidden by macro definition [-Wkeyword-macro]
#   define static_assert _Static_assert /* C11 requires this #define. */
           ^
In file included from ../../../gettext-runtime/libasprintf/autosprintf.cc:21:
In file included from .\autosprintf.h:35:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\string:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\istream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ostream:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\ios:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xlocnum:6:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\climits:5:
In file included from C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\yvals.h:7:
C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\xkeycheck.h(250,5): error: The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.
   #error The C++ Standard Library forbids macroizing keywords. Enable warning C4005 to find the forbidden macro.
    ^

This patch fixes it. Similarly to what we did with g++ 6.


2022-09-14  Bruno Haible  <bruno@clisp.org>

	verify: Avoid syntax error due to static_assert with clang in C++ mode.
	* lib/verify.h (static_assert): Don't define in clang C++ 6 or newer.
	* m4/assert_h.m4 (gl_ASSERT_H): If we don't need to define static_assert
	with clang in C++ mode, don't include <assert.h>.

diff --git a/lib/verify.h b/lib/verify.h
index 0f5f0edc86..99af802993 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -228,7 +228,9 @@ template <int w>
 # endif
 # if (!defined static_assert \
       && __STDC_VERSION__ < 202311 \
-      && __cpp_static_assert < 201411 && __GNUG__ < 6)
+      && (!defined __cplusplus \
+          || (__cpp_static_assert < 201411 \
+              && __GNUG__ < 6 && __clang_major__ < 6)))
 #  if defined __cplusplus && _MSC_VER >= 1900 && !defined __clang__
 /* MSVC 14 in C++ mode supports the two-arguments static_assert but not
    the one-argument static_assert, and it does not support _Static_assert.
diff --git a/m4/assert_h.m4 b/m4/assert_h.m4
index 43937869ec..d61572113c 100644
--- a/m4/assert_h.m4
+++ b/m4/assert_h.m4
@@ -48,7 +48,9 @@ AC_DEFUN([gl_ASSERT_H],
   dnl so that 'configure' does not comment it out.
   AH_VERBATIM([zzstatic_assert],
 [#if (!defined HAVE_C_STATIC_ASSERT && !defined assert \
-     && __cpp_static_assert < 201411 && __GNUG__ < 6)
+     && (!defined __cplusplus \
+         || (__cpp_static_assert < 201411 \
+             && __GNUG__ < 6 && __clang_major__ < 6)))
  #include <assert.h>
  #undef/**/assert
 #endif])





^ permalink raw reply related	[flat|nested] 13+ messages in thread

* Re: [PROPOSED 2/2] assert-h: prefer to ‘verify’
  2022-09-14 11:35   ` Bruno Haible
@ 2022-12-28 22:41     ` Paul Eggert
  0 siblings, 0 replies; 13+ messages in thread
From: Paul Eggert @ 2022-12-28 22:41 UTC (permalink / raw)
  To: Bruno Haible; +Cc: bug-gnulib

[-- Attachment #1: Type: text/plain, Size: 933 bytes --]

On 9/14/22 04:35, Bruno Haible wrote:
> -#  define _Static_assert(...) \
> -     _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
> +#  define _Static_assert(R, ...) \
> +     _GL_VERIFY ((R), "static assertion failed", -)

Unfortunately this doesn't conform to strict C99, which requires the 
updated _Static_assert to be called with at least two arguments. I 
discovered this while compiling bleeding-edge gzip on AIX and on 
Solaris. I worked around the problem by installing the attached patch, 
though since I don't use MSVC I'm not sure I got the new #if exactly right.

Also, does MSVC require the "(R)" to be parenthesized? I also noticed 
what would ordinarily be unnecessary parentheses later on, in the 
MSVC-specific '#   define _GL_SA1(a1) static_assert ((a1), "static 
assertion failed")'. Ordinarily I like to leave those parentheses out 
but if MSVC needs them obviously we should keep them.

[-- Attachment #2: 0001-assert-h-port-static_assert-to-strict-C99.patch --]
[-- Type: text/x-patch, Size: 3400 bytes --]

From 14a7b0ce5462c90ce86d97bf952185ec2500d341 Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 28 Dec 2022 14:15:43 -0800
Subject: [PATCH] assert-h: port static_assert to strict C99
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

* lib/verify.h (_GL_VERIFY): Port MSVC hack back to C99.
Problem found when testing bleeding-edge gzip on IBM XL C for AIX,
V12.1 (5765-J02, 5725-C72), which complained ‘"malloca.c", line
42.56: 1506-041 (E) The invocation of macro _Static_assert
contains fewer arguments than are required by the macro
definition.’  This diagnostic is valid because C99 requires
that if you #define _Static_assert(R, ...) you must call
_Static_assert with at least two arguments.  I found a similar
problem with Sun C 5.9 SunOS_sparc Patch 124867-12 2009/11/22.
---
 ChangeLog    | 13 +++++++++++++
 lib/verify.h | 16 +++++++++++-----
 2 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index be0fb22078..49f88777eb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2022-12-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+	assert-h: port static_assert to strict C99
+	* lib/verify.h (_GL_VERIFY): Port MSVC hack back to C99.
+	Problem found when testing bleeding-edge gzip on IBM XL C for AIX,
+	V12.1 (5765-J02, 5725-C72), which complained ‘"malloca.c", line
+	42.56: 1506-041 (E) The invocation of macro _Static_assert
+	contains fewer arguments than are required by the macro
+	definition.’  This diagnostic is valid because C99 requires
+	that if you #define _Static_assert(R, ...) you must call
+	_Static_assert with at least two arguments.  I found a similar
+	problem with Sun C 5.9 SunOS_sparc Patch 124867-12 2009/11/22.
+
 2022-12-27  Paul Eggert  <eggert@cs.ucla.edu>
 
 	file-has-acl: fix recently-introduced NFSv4 bug
diff --git a/lib/verify.h b/lib/verify.h
index 5225a8e616..cb635a9fc2 100644
--- a/lib/verify.h
+++ b/lib/verify.h
@@ -223,8 +223,15 @@ template <int w>
 /* _GL_STATIC_ASSERT_H is defined if this code is copied into assert.h.  */
 #ifdef _GL_STATIC_ASSERT_H
 # if !defined _GL_HAVE__STATIC_ASSERT1 && !defined _Static_assert
-#  define _Static_assert(R, ...) \
-     _GL_VERIFY ((R), "static assertion failed", -)
+#  if !defined _MSC_VER || defined __clang__
+#   define _Static_assert(...) \
+      _GL_VERIFY (__VA_ARGS__, "static assertion failed", -)
+#  else
+    /* Work around MSVC preprocessor incompatibility with ISO C; see
+       <https://stackoverflow.com/questions/5134523/>.  */
+#   define _Static_assert(R, ...) \
+      _GL_VERIFY ((R), "static assertion failed", -)
+#  endif
 # endif
 # if (!defined static_assert \
       && __STDC_VERSION__ < 202311 \
@@ -235,9 +242,8 @@ template <int w>
 /* MSVC 14 in C++ mode supports the two-arguments static_assert but not
    the one-argument static_assert, and it does not support _Static_assert.
    We have to play preprocessor tricks to distinguish the two cases.
-   Since the MSVC preprocessor is not ISO C compliant (cf.
-   <https://stackoverflow.com/questions/5134523/>), the solution is specific
-   to MSVC.  */
+   Since the MSVC preprocessor is not ISO C compliant (see above),.
+   the solution is specific to MSVC.  */
 #   define _GL_EXPAND(x) x
 #   define _GL_SA1(a1) static_assert ((a1), "static assertion failed")
 #   define _GL_SA2 static_assert
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2022-12-28 22:41 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13  3:32 [PROPOSED 0/2] static_assert and C23 Paul Eggert
2022-09-13  3:32 ` [PROPOSED 1/2] assert-h: static_assert is a keyword in C23 Paul Eggert
2022-09-13  3:32 ` [PROPOSED 2/2] assert-h: prefer to ‘verify’ Paul Eggert
2022-09-14  1:05   ` Bruno Haible
2022-09-14  4:47     ` Paul Eggert
2022-09-14  6:04       ` Bruno Haible
2022-09-14 11:35   ` Bruno Haible
2022-12-28 22:41     ` Paul Eggert
2022-09-14 13:43   ` Bruno Haible
2022-09-14 16:10     ` Bruno Haible
2022-09-14 20:22   ` Bruno Haible
2022-09-13 22:50 ` [PROPOSED 0/2] static_assert and C23 Bruno Haible
2022-09-13 23:06   ` Paul Eggert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).