]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
build: switch to using static_assert instead of verify
authorDaiki Ueno <ueno@gnu.org>
Sun, 26 Apr 2026 02:10:10 +0000 (11:10 +0900)
committerDaiki Ueno <ueno@gnu.org>
Mon, 27 Apr 2026 02:11:53 +0000 (11:11 +0900)
Gnulib now emulates static_assert in C23, prefer it over verify.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
bootstrap.conf
lib/hello_ext.c
lib/x509/name_constraints.c

index 21b648203abefc9802995e879604cf65b8368ad8..d647a1cdd10c6cd9194e76346a35ceecb59552cd 100644 (file)
@@ -27,7 +27,7 @@ required_submodules="tests/suite/tls-fuzzer/python-ecdsa tests/suite/tls-fuzzer/
 
 # Those modules are common to lib/ and src/.
 common_modules="
-alloca array-list attribute byteswap c-ctype c-strcase canonicalize-lgpl explicit_bzero fopen-gnu func getline gettext-h gettimeofday hash-pjw-bare arpa_inet inet_ntop inet_pton intprops linkedhash-list lock memmem-simple minmax netdb netinet_in pathmax rbtree-list read-file secure_getenv setsockopt snprintf stdint stpcpy strcase strdup-posix strndup strtok_r strverscmp sys_socket sys_stat sys_types threadlib time_r tls unistd valgrind-tests vasprintf verify vsnprintf xalloc-oversized
+alloca array-list assert-h attribute byteswap c-ctype c-strcase canonicalize-lgpl explicit_bzero fopen-gnu func getline gettext-h gettimeofday hash-pjw-bare arpa_inet inet_ntop inet_pton intprops linkedhash-list lock memmem-simple minmax netdb netinet_in pathmax rbtree-list read-file secure_getenv setsockopt snprintf stdint stpcpy strcase strdup-posix strndup strtok_r strverscmp sys_socket sys_stat sys_types threadlib time_r tls unistd valgrind-tests vasprintf vsnprintf xalloc-oversized
 "
 gnulib_modules="
 $common_modules dirname-lgpl extensions gendocs havelib ldd lib-msvc-compat lib-symbol-versions maintainer-makefile manywarnings pmccabe2html warnings
index 60f33ae3ded1b5d377b226e0adfac72fe7c48f07..0cc3bbc7e1f8f8f370da0635967bc4f5cd980456 100644 (file)
 #include "ext/server_cert_type.h"
 #include "ext/compress_certificate.h"
 #include "intprops.h"
-#include "verify.h"
 
-verify(GNUTLS_EXTENSION_MAX < GNUTLS_EXTENSION_MAX_VALUE);
-verify(GNUTLS_EXTENSION_MAX < MAX_EXT_TYPES);
+static_assert(GNUTLS_EXTENSION_MAX < GNUTLS_EXTENSION_MAX_VALUE);
+static_assert(GNUTLS_EXTENSION_MAX < MAX_EXT_TYPES);
 
 /* we must provide at least 16 extensions for users to register;
  * increase GNUTLS_EXTENSION_MAX_VALUE, MAX_EXT_TYPES and used_exts
  * type if this fails
  */
-verify(GNUTLS_EXTENSION_MAX_VALUE - GNUTLS_EXTENSION_MAX >= 16);
+static_assert(GNUTLS_EXTENSION_MAX_VALUE - GNUTLS_EXTENSION_MAX >= 16);
 
 /* MAX_EXT_TYPES must fit in a single byte, to generate random
  * permutation at once.
  */
-verify(MAX_EXT_TYPES <= UINT8_MAX);
+static_assert(MAX_EXT_TYPES <= UINT8_MAX);
 
 static void unset_ext_data(gnutls_session_t session,
                           const struct hello_ext_entry_st *, unsigned idx);
index 5970643239df89732902c7d68d5e1dbd9bd6e579..a89728451615707ff4395f4736c7df371380f01c 100644 (file)
@@ -42,7 +42,6 @@
 #include "minmax.h"
 #include "gl_array_list.h"
 #include "gl_rbtree_list.h"
-#include "verify.h"
 
 #include <assert.h>
 #include <string.h>
@@ -65,8 +64,8 @@ typedef unsigned long san_flags_t;
        ((san) <= GNUTLS_SAN_MAX ? (san) - SAN_MIN : \
                                   GNUTLS_SAN_MAX + (san) - SAN_OTHERNAME_MIN)
 
-verify(SAN_BIT(SAN_OTHERNAME_MIN) > SAN_BIT(GNUTLS_SAN_MAX));
-verify(SAN_BIT(SAN_OTHERNAME_MAX) < CHAR_BIT * sizeof(san_flags_t));
+static_assert(SAN_BIT(SAN_OTHERNAME_MIN) > SAN_BIT(GNUTLS_SAN_MAX));
+static_assert(SAN_BIT(SAN_OTHERNAME_MAX) < CHAR_BIT * sizeof(san_flags_t));
 
 #define SAN_FLAG(san) (1UL << SAN_BIT(san))