aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib-src/asset-directory-tool.c4
-rw-r--r--src/alloc.c26
-rw-r--r--src/android.c4
-rw-r--r--src/android.h2
-rw-r--r--src/androidfont.c4
-rw-r--r--src/androidvfs.c2
-rw-r--r--src/bidi.c4
-rw-r--r--src/buffer.c4
-rw-r--r--src/casefiddle.c2
-rw-r--r--src/character.h1
-rw-r--r--src/decompress.c2
-rw-r--r--src/dispnew.c6
-rw-r--r--src/editfns.c3
-rw-r--r--src/emacs-module.c13
-rw-r--r--src/eval.c2
-rw-r--r--src/fileio.c4
-rw-r--r--src/fns.c4
-rw-r--r--src/fringe.c2
-rw-r--r--src/keyboard.h4
-rw-r--r--src/keymap.c2
-rw-r--r--src/lisp.h55
-rw-r--r--src/lread.c2
-rw-r--r--src/nsgui.h6
-rw-r--r--src/pdumper.c26
-rw-r--r--src/process.c13
-rw-r--r--src/regex-emacs.c2
-rw-r--r--src/sort.c2
-rw-r--r--src/sysdep.c12
-rw-r--r--src/thread.c2
-rw-r--r--src/timefns.c2
-rw-r--r--src/unexelf.c7
-rw-r--r--src/xterm.c2
32 files changed, 106 insertions, 120 deletions
diff --git a/lib-src/asset-directory-tool.c b/lib-src/asset-directory-tool.c
index 23f4655448c..a95bbd4735e 100644
--- a/lib-src/asset-directory-tool.c
+++ b/lib-src/asset-directory-tool.c
@@ -20,7 +20,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
20#include <config.h> 20#include <config.h>
21 21
22#include <stdio.h> 22#include <stdio.h>
23#include <verify.h> 23#include <assert.h>
24#include <fcntl.h> 24#include <fcntl.h>
25#include <errno.h> 25#include <errno.h>
26#include <byteswap.h> 26#include <byteswap.h>
@@ -236,7 +236,7 @@ main_2 (int fd, struct directory_tree *tree, size_t *offset)
236 output[0] = (unsigned int) tree->st_size; 236 output[0] = (unsigned int) tree->st_size;
237#endif /* !WORDS_BIGENDIAN */ 237#endif /* !WORDS_BIGENDIAN */
238 238
239 verify (sizeof output == 8 && sizeof output[0] == 4); 239 static_assert (sizeof output == 8 && sizeof output[0] == 4);
240 if (!need_file_size) 240 if (!need_file_size)
241 { 241 {
242 if (write (fd, output + 1, 4) < 1) 242 if (write (fd, output + 1, 4) < 1)
diff --git a/src/alloc.c b/src/alloc.c
index 48b170b866f..89729b0073b 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -709,7 +709,7 @@ buffer_memory_full (ptrdiff_t nbytes)
709 where Emacs would crash if malloc returned a non-GCALIGNED pointer. */ 709 where Emacs would crash if malloc returned a non-GCALIGNED pointer. */
710enum { LISP_ALIGNMENT = alignof (union { union emacs_align_type x; 710enum { LISP_ALIGNMENT = alignof (union { union emacs_align_type x;
711 GCALIGNED_UNION_MEMBER }) }; 711 GCALIGNED_UNION_MEMBER }) };
712verify (LISP_ALIGNMENT % GCALIGNMENT == 0); 712static_assert (LISP_ALIGNMENT % GCALIGNMENT == 0);
713 713
714/* True if malloc (N) is known to return storage suitably aligned for 714/* True if malloc (N) is known to return storage suitably aligned for
715 Lisp objects whenever N is a multiple of LISP_ALIGNMENT. In 715 Lisp objects whenever N is a multiple of LISP_ALIGNMENT. In
@@ -839,7 +839,7 @@ xfree (void *block)
839/* Other parts of Emacs pass large int values to allocator functions 839/* Other parts of Emacs pass large int values to allocator functions
840 expecting ptrdiff_t. This is portable in practice, but check it to 840 expecting ptrdiff_t. This is portable in practice, but check it to
841 be safe. */ 841 be safe. */
842verify (INT_MAX <= PTRDIFF_MAX); 842static_assert (INT_MAX <= PTRDIFF_MAX);
843 843
844 844
845/* Allocate an array of NITEMS items, each of size ITEM_SIZE. 845/* Allocate an array of NITEMS items, each of size ITEM_SIZE.
@@ -1076,7 +1076,7 @@ lisp_free (void *block)
1076#else /* !HAVE_UNEXEC */ 1076#else /* !HAVE_UNEXEC */
1077# define BLOCK_ALIGN (1 << 15) 1077# define BLOCK_ALIGN (1 << 15)
1078#endif 1078#endif
1079verify (POWER_OF_2 (BLOCK_ALIGN)); 1079static_assert (POWER_OF_2 (BLOCK_ALIGN));
1080 1080
1081/* Use aligned_alloc if it or a simple substitute is available. 1081/* Use aligned_alloc if it or a simple substitute is available.
1082 Aligned allocation is incompatible with unexmacosx.c, so don't use 1082 Aligned allocation is incompatible with unexmacosx.c, so don't use
@@ -1096,11 +1096,11 @@ aligned_alloc (size_t alignment, size_t size)
1096{ 1096{
1097 /* POSIX says the alignment must be a power-of-2 multiple of sizeof (void *). 1097 /* POSIX says the alignment must be a power-of-2 multiple of sizeof (void *).
1098 Verify this for all arguments this function is given. */ 1098 Verify this for all arguments this function is given. */
1099 verify (BLOCK_ALIGN % sizeof (void *) == 0 1099 static_assert (BLOCK_ALIGN % sizeof (void *) == 0
1100 && POWER_OF_2 (BLOCK_ALIGN / sizeof (void *))); 1100 && POWER_OF_2 (BLOCK_ALIGN / sizeof (void *)));
1101 verify (MALLOC_IS_LISP_ALIGNED 1101 static_assert (MALLOC_IS_LISP_ALIGNED
1102 || (LISP_ALIGNMENT % sizeof (void *) == 0 1102 || (LISP_ALIGNMENT % sizeof (void *) == 0
1103 && POWER_OF_2 (LISP_ALIGNMENT / sizeof (void *)))); 1103 && POWER_OF_2 (LISP_ALIGNMENT / sizeof (void *))));
1104 eassert (alignment == BLOCK_ALIGN 1104 eassert (alignment == BLOCK_ALIGN
1105 || (!MALLOC_IS_LISP_ALIGNED && alignment == LISP_ALIGNMENT)); 1105 || (!MALLOC_IS_LISP_ALIGNED && alignment == LISP_ALIGNMENT));
1106 1106
@@ -1221,7 +1221,7 @@ lisp_align_malloc (size_t nbytes, enum mem_type type)
1221#endif 1221#endif
1222 1222
1223#ifdef USE_ALIGNED_ALLOC 1223#ifdef USE_ALIGNED_ALLOC
1224 verify (ABLOCKS_BYTES % BLOCK_ALIGN == 0); 1224 static_assert (ABLOCKS_BYTES % BLOCK_ALIGN == 0);
1225 abase = base = aligned_alloc (BLOCK_ALIGN, ABLOCKS_BYTES); 1225 abase = base = aligned_alloc (BLOCK_ALIGN, ABLOCKS_BYTES);
1226#else 1226#else
1227 base = malloc (ABLOCKS_BYTES); 1227 base = malloc (ABLOCKS_BYTES);
@@ -3048,7 +3048,7 @@ enum { VECTOR_BLOCK_SIZE = 4096 };
3048enum { roundup_size = COMMON_MULTIPLE (LISP_ALIGNMENT, word_size) }; 3048enum { roundup_size = COMMON_MULTIPLE (LISP_ALIGNMENT, word_size) };
3049 3049
3050/* Verify assumption described above. */ 3050/* Verify assumption described above. */
3051verify (VECTOR_BLOCK_SIZE % roundup_size == 0); 3051static_assert (VECTOR_BLOCK_SIZE % roundup_size == 0);
3052 3052
3053/* Round up X to nearest mult-of-ROUNDUP_SIZE --- use at compile time. */ 3053/* Round up X to nearest mult-of-ROUNDUP_SIZE --- use at compile time. */
3054#define vroundup_ct(x) ROUNDUP (x, roundup_size) 3054#define vroundup_ct(x) ROUNDUP (x, roundup_size)
@@ -3062,7 +3062,7 @@ enum {VECTOR_BLOCK_BYTES = VECTOR_BLOCK_SIZE - vroundup_ct (sizeof (void *))};
3062/* The current code expects to be able to represent an unused block by 3062/* The current code expects to be able to represent an unused block by
3063 a single PVEC_FREE object, whose size is limited by the header word. 3063 a single PVEC_FREE object, whose size is limited by the header word.
3064 (Of course we could use multiple such objects.) */ 3064 (Of course we could use multiple such objects.) */
3065verify (VECTOR_BLOCK_BYTES <= (word_size << PSEUDOVECTOR_REST_BITS)); 3065static_assert (VECTOR_BLOCK_BYTES <= (word_size << PSEUDOVECTOR_REST_BITS));
3066 3066
3067/* Size of the minimal vector allocated from block. */ 3067/* Size of the minimal vector allocated from block. */
3068 3068
@@ -3319,7 +3319,7 @@ vectorlike_nbytes (const union vectorlike_header *hdr)
3319 ptrdiff_t word_bytes = (bool_vector_words (bv->size) 3319 ptrdiff_t word_bytes = (bool_vector_words (bv->size)
3320 * sizeof (bits_word)); 3320 * sizeof (bits_word));
3321 ptrdiff_t boolvec_bytes = bool_header_size + word_bytes; 3321 ptrdiff_t boolvec_bytes = bool_header_size + word_bytes;
3322 verify (header_size <= bool_header_size); 3322 static_assert (header_size <= bool_header_size);
3323 nwords = (boolvec_bytes - header_size + word_size - 1) / word_size; 3323 nwords = (boolvec_bytes - header_size + word_size - 1) / word_size;
3324 } 3324 }
3325 else 3325 else
@@ -3699,7 +3699,7 @@ allocate_pseudovector (int memlen, int lisplen,
3699 /* Catch bogus values. */ 3699 /* Catch bogus values. */
3700 enum { size_max = (1 << PSEUDOVECTOR_SIZE_BITS) - 1 }; 3700 enum { size_max = (1 << PSEUDOVECTOR_SIZE_BITS) - 1 };
3701 enum { rest_max = (1 << PSEUDOVECTOR_REST_BITS) - 1 }; 3701 enum { rest_max = (1 << PSEUDOVECTOR_REST_BITS) - 1 };
3702 verify (size_max + rest_max <= VECTOR_ELTS_MAX); 3702 static_assert (size_max + rest_max <= VECTOR_ELTS_MAX);
3703 eassert (0 <= tag && tag <= PVEC_TAG_MAX); 3703 eassert (0 <= tag && tag <= PVEC_TAG_MAX);
3704 eassert (0 <= lisplen && lisplen <= zerolen && zerolen <= memlen); 3704 eassert (0 <= lisplen && lisplen <= zerolen && zerolen <= memlen);
3705 eassert (lisplen <= size_max); 3705 eassert (lisplen <= size_max);
diff --git a/src/android.c b/src/android.c
index d7a17c519a1..59962ead027 100644
--- a/src/android.c
+++ b/src/android.c
@@ -2969,7 +2969,7 @@ android_globalize_reference (jobject handle)
2969 (*android_java_env)->SetLongField (android_java_env, global, 2969 (*android_java_env)->SetLongField (android_java_env, global,
2970 handle_class.handle, 2970 handle_class.handle,
2971 (jlong) global); 2971 (jlong) global);
2972 verify (sizeof (jlong) >= sizeof (intptr_t)); 2972 static_assert (sizeof (jlong) >= sizeof (intptr_t));
2973 return (intptr_t) global; 2973 return (intptr_t) global;
2974} 2974}
2975 2975
@@ -3521,7 +3521,7 @@ android_set_dashes (struct android_gc *gc, int dash_offset,
3521 /* Copy the list of segments into both arrays. */ 3521 /* Copy the list of segments into both arrays. */
3522 for (i = 0; i < n; ++i) 3522 for (i = 0; i < n; ++i)
3523 gc->dashes[i] = dash_list[i]; 3523 gc->dashes[i] = dash_list[i];
3524 verify (sizeof (int) == sizeof (jint)); 3524 static_assert (sizeof (int) == sizeof (jint));
3525 (*android_java_env)->SetIntArrayRegion (android_java_env, 3525 (*android_java_env)->SetIntArrayRegion (android_java_env,
3526 array, 0, n, 3526 array, 0, n,
3527 (jint *) dash_list); 3527 (jint *) dash_list);
diff --git a/src/android.h b/src/android.h
index 29459b063f3..8d2e5a2c432 100644
--- a/src/android.h
+++ b/src/android.h
@@ -103,7 +103,7 @@ extern ssize_t android_readlinkat (int, const char *restrict, char *restrict,
103extern double android_pixel_density_x, android_pixel_density_y; 103extern double android_pixel_density_x, android_pixel_density_y;
104extern double android_scaled_pixel_density; 104extern double android_scaled_pixel_density;
105 105
106verify (sizeof (android_handle) == sizeof (jobject)); 106static_assert (sizeof (android_handle) == sizeof (jobject));
107#define android_resolve_handle(handle) ((jobject) (handle)) 107#define android_resolve_handle(handle) ((jobject) (handle))
108 108
109extern unsigned char *android_lock_bitmap (android_drawable, 109extern unsigned char *android_lock_bitmap (android_drawable,
diff --git a/src/androidfont.c b/src/androidfont.c
index 5cd23a006e8..96dcffa45ec 100644
--- a/src/androidfont.c
+++ b/src/androidfont.c
@@ -654,7 +654,7 @@ androidfont_draw (struct glyph_string *s, int from, int to,
654 /* Maybe initialize the font driver. */ 654 /* Maybe initialize the font driver. */
655 androidfont_check_init (); 655 androidfont_check_init ();
656 656
657 verify (sizeof (unsigned int) == sizeof (jint)); 657 static_assert (sizeof (unsigned int) == sizeof (jint));
658 info = (struct androidfont_info *) s->font; 658 info = (struct androidfont_info *) s->font;
659 659
660 gcontext = android_resolve_handle (s->gc->gcontext); 660 gcontext = android_resolve_handle (s->gc->gcontext);
@@ -932,7 +932,7 @@ androidfont_text_extents (struct font *font, const unsigned int *code,
932 memory_full (0); 932 memory_full (0);
933 } 933 }
934 934
935 verify (sizeof (unsigned int) == sizeof (jint)); 935 static_assert (sizeof (unsigned int) == sizeof (jint));
936 936
937 /* Always true on every Android device. */ 937 /* Always true on every Android device. */
938 (*android_java_env)->SetIntArrayRegion (android_java_env, 938 (*android_java_env)->SetIntArrayRegion (android_java_env,
diff --git a/src/androidvfs.c b/src/androidvfs.c
index bb855099c77..d09965eb755 100644
--- a/src/androidvfs.c
+++ b/src/androidvfs.c
@@ -259,7 +259,7 @@ struct android_special_vnode
259 Lisp_Object special_coding_system; 259 Lisp_Object special_coding_system;
260}; 260};
261 261
262verify (NIL_IS_ZERO); /* special_coding_system above. */ 262static_assert (NIL_IS_ZERO); /* special_coding_system above. */
263 263
264enum android_vnode_type 264enum android_vnode_type
265 { 265 {
diff --git a/src/bidi.c b/src/bidi.c
index bdf60001781..6dbfab37ea3 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -566,7 +566,7 @@ bidi_copy_it (struct bidi_it *to, struct bidi_it *from)
566 RTL characters in the offending line of text. */ 566 RTL characters in the offending line of text. */
567/* Do we need to allow customization of this limit? */ 567/* Do we need to allow customization of this limit? */
568#define BIDI_CACHE_MAX_ELTS_PER_SLOT 50000 568#define BIDI_CACHE_MAX_ELTS_PER_SLOT 50000
569verify (BIDI_CACHE_CHUNK < BIDI_CACHE_MAX_ELTS_PER_SLOT); 569static_assert (BIDI_CACHE_CHUNK < BIDI_CACHE_MAX_ELTS_PER_SLOT);
570static ptrdiff_t bidi_cache_max_elts = BIDI_CACHE_MAX_ELTS_PER_SLOT; 570static ptrdiff_t bidi_cache_max_elts = BIDI_CACHE_MAX_ELTS_PER_SLOT;
571static struct bidi_it *bidi_cache; 571static struct bidi_it *bidi_cache;
572static ptrdiff_t bidi_cache_size = 0; 572static ptrdiff_t bidi_cache_size = 0;
@@ -2626,7 +2626,7 @@ bidi_find_bracket_pairs (struct bidi_it *bidi_it)
2626 ptrdiff_t pairing_pos; 2626 ptrdiff_t pairing_pos;
2627 int idx_at_entry = bidi_cache_idx; 2627 int idx_at_entry = bidi_cache_idx;
2628 2628
2629 verify (MAX_BPA_STACK >= 100); 2629 static_assert (MAX_BPA_STACK >= 100);
2630 bidi_copy_it (&saved_it, bidi_it); 2630 bidi_copy_it (&saved_it, bidi_it);
2631 /* bidi_cache_iterator_state refuses to cache on backward scans, 2631 /* bidi_cache_iterator_state refuses to cache on backward scans,
2632 and bidi_cache_fetch_state doesn't bring scan_dir from the 2632 and bidi_cache_fetch_state doesn't bring scan_dir from the
diff --git a/src/buffer.c b/src/buffer.c
index 744b0ef5548..c56651932f9 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -27,8 +27,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
27#include <stdlib.h> 27#include <stdlib.h>
28#include <unistd.h> 28#include <unistd.h>
29 29
30#include <verify.h>
31
32#include "lisp.h" 30#include "lisp.h"
33#include "intervals.h" 31#include "intervals.h"
34#include "process.h" 32#include "process.h"
@@ -4853,7 +4851,7 @@ init_buffer_once (void)
4853 The local flag bits are in the local_var_flags slot of the buffer. */ 4851 The local flag bits are in the local_var_flags slot of the buffer. */
4854 4852
4855 /* Nothing can work if this isn't true. */ 4853 /* Nothing can work if this isn't true. */
4856 { verify (sizeof (EMACS_INT) == word_size); } 4854 { static_assert (sizeof (EMACS_INT) == word_size); }
4857 4855
4858 Vbuffer_alist = Qnil; 4856 Vbuffer_alist = Qnil;
4859 current_buffer = 0; 4857 current_buffer = 0;
diff --git a/src/casefiddle.c b/src/casefiddle.c
index b252f07ae13..4cf15433c35 100644
--- a/src/casefiddle.c
+++ b/src/casefiddle.c
@@ -285,7 +285,7 @@ do_casify_multibyte_string (struct casing_context *ctx, Lisp_Object obj)
285 representation of the character is at the beginning of the 285 representation of the character is at the beginning of the
286 buffer. This is why we don’t need a separate struct 286 buffer. This is why we don’t need a separate struct
287 casing_str_buf object, and can write directly to the destination. */ 287 casing_str_buf object, and can write directly to the destination. */
288 verify (offsetof (struct casing_str_buf, data) == 0); 288 static_assert (offsetof (struct casing_str_buf, data) == 0);
289 289
290 ptrdiff_t size = SCHARS (obj), n; 290 ptrdiff_t size = SCHARS (obj), n;
291 USE_SAFE_ALLOCA; 291 USE_SAFE_ALLOCA;
diff --git a/src/character.h b/src/character.h
index 6d0f035c2bb..67eaf8934ef 100644
--- a/src/character.h
+++ b/src/character.h
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
23#ifndef EMACS_CHARACTER_H 23#ifndef EMACS_CHARACTER_H
24#define EMACS_CHARACTER_H 24#define EMACS_CHARACTER_H
25 25
26#include <verify.h>
27#include "lisp.h" 26#include "lisp.h"
28 27
29INLINE_HEADER_BEGIN 28INLINE_HEADER_BEGIN
diff --git a/src/decompress.c b/src/decompress.c
index 6c342e54355..839f6c341d1 100644
--- a/src/decompress.c
+++ b/src/decompress.c
@@ -27,8 +27,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
27#include "composite.h" 27#include "composite.h"
28#include "md5.h" 28#include "md5.h"
29 29
30#include <verify.h>
31
32#ifdef WINDOWSNT 30#ifdef WINDOWSNT
33# include <windows.h> 31# include <windows.h>
34# include "w32common.h" 32# include "w32common.h"
diff --git a/src/dispnew.c b/src/dispnew.c
index 8bbb818bc19..1a243079e46 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -4667,7 +4667,7 @@ scrolling_window (struct window *w, int tab_line_p)
4667 13, then next_almost_prime_increment_max would be 14, e.g., 4667 13, then next_almost_prime_increment_max would be 14, e.g.,
4668 because next_almost_prime (113) would be 127. */ 4668 because next_almost_prime (113) would be 127. */
4669 { 4669 {
4670 verify (NEXT_ALMOST_PRIME_LIMIT == 11); 4670 static_assert (NEXT_ALMOST_PRIME_LIMIT == 11);
4671 enum { next_almost_prime_increment_max = 10 }; 4671 enum { next_almost_prime_increment_max = 10 };
4672 ptrdiff_t row_table_max = 4672 ptrdiff_t row_table_max =
4673 (min (PTRDIFF_MAX, SIZE_MAX) / (3 * sizeof *row_table) 4673 (min (PTRDIFF_MAX, SIZE_MAX) / (3 * sizeof *row_table)
@@ -5118,8 +5118,8 @@ scrolling (struct frame *frame)
5118 int free_at_end_vpos = height; 5118 int free_at_end_vpos = height;
5119 struct glyph_matrix *current_matrix = frame->current_matrix; 5119 struct glyph_matrix *current_matrix = frame->current_matrix;
5120 struct glyph_matrix *desired_matrix = frame->desired_matrix; 5120 struct glyph_matrix *desired_matrix = frame->desired_matrix;
5121 verify (sizeof (int) <= sizeof (unsigned)); 5121 static_assert (sizeof (int) <= sizeof (unsigned));
5122 verify (alignof (unsigned) % alignof (int) == 0); 5122 static_assert (alignof (unsigned) % alignof (int) == 0);
5123 unsigned *old_hash; 5123 unsigned *old_hash;
5124 USE_SAFE_ALLOCA; 5124 USE_SAFE_ALLOCA;
5125 SAFE_NALLOCA (old_hash, 4, height); 5125 SAFE_NALLOCA (old_hash, 4, height);
diff --git a/src/editfns.c b/src/editfns.c
index 6b110b3d0e0..07fe3c68da0 100644
--- a/src/editfns.c
+++ b/src/editfns.c
@@ -46,7 +46,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
46#include <c-ctype.h> 46#include <c-ctype.h>
47#include <intprops.h> 47#include <intprops.h>
48#include <stdlib.h> 48#include <stdlib.h>
49#include <verify.h>
50 49
51#include "composite.h" 50#include "composite.h"
52#include "intervals.h" 51#include "intervals.h"
@@ -3408,7 +3407,7 @@ styled_format (ptrdiff_t nargs, Lisp_Object *args, bool message)
3408 SPRINTF_BUFSIZE = (sizeof "-." + (LDBL_MAX_10_EXP + 1) 3407 SPRINTF_BUFSIZE = (sizeof "-." + (LDBL_MAX_10_EXP + 1)
3409 + USEFUL_PRECISION_MAX) 3408 + USEFUL_PRECISION_MAX)
3410 }; 3409 };
3411 verify (USEFUL_PRECISION_MAX > 0); 3410 static_assert (USEFUL_PRECISION_MAX > 0);
3412 3411
3413 ptrdiff_t n; /* The number of the next arg to substitute. */ 3412 ptrdiff_t n; /* The number of the next arg to substitute. */
3414 char initial_buffer[1000 + SPRINTF_BUFSIZE]; 3413 char initial_buffer[1000 + SPRINTF_BUFSIZE];
diff --git a/src/emacs-module.c b/src/emacs-module.c
index 05aa0baef74..30063180d6c 100644
--- a/src/emacs-module.c
+++ b/src/emacs-module.c
@@ -94,7 +94,6 @@ To add a new module function, proceed as follows:
94#include "thread.h" 94#include "thread.h"
95 95
96#include <intprops.h> 96#include <intprops.h>
97#include <verify.h>
98 97
99/* Work around GCC bug 83162. */ 98/* Work around GCC bug 83162. */
100#if GNUC_PREREQ (4, 3, 0) 99#if GNUC_PREREQ (4, 3, 0)
@@ -1036,10 +1035,10 @@ import/export overhead on most platforms.
1036 1035
1037/* Verify that emacs_limb_t indeed has unique object 1036/* Verify that emacs_limb_t indeed has unique object
1038 representations. */ 1037 representations. */
1039verify (CHAR_BIT == 8); 1038static_assert (CHAR_BIT == 8);
1040verify ((sizeof (emacs_limb_t) == 4 && EMACS_LIMB_MAX == 0xFFFFFFFF) 1039static_assert ((sizeof (emacs_limb_t) == 4 && EMACS_LIMB_MAX == 0xFFFFFFFF)
1041 || (sizeof (emacs_limb_t) == 8 1040 || (sizeof (emacs_limb_t) == 8
1042 && EMACS_LIMB_MAX == 0xFFFFFFFFFFFFFFFF)); 1041 && EMACS_LIMB_MAX == 0xFFFFFFFFFFFFFFFF));
1043 1042
1044static bool 1043static bool
1045module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign, 1044module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign,
@@ -1077,7 +1076,7 @@ module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign,
1077 suffice. */ 1076 suffice. */
1078 EMACS_UINT u; 1077 EMACS_UINT u;
1079 enum { required = (sizeof u + size - 1) / size }; 1078 enum { required = (sizeof u + size - 1) / size };
1080 verify (0 < required && +required <= module_bignum_count_max); 1079 static_assert (0 < required && +required <= module_bignum_count_max);
1081 if (magnitude == NULL) 1080 if (magnitude == NULL)
1082 { 1081 {
1083 *count = required; 1082 *count = required;
@@ -1097,7 +1096,7 @@ module_extract_big_integer (emacs_env *env, emacs_value arg, int *sign,
1097 u = (EMACS_UINT) x; 1096 u = (EMACS_UINT) x;
1098 else 1097 else
1099 u = -(EMACS_UINT) x; 1098 u = -(EMACS_UINT) x;
1100 verify (required * bits < PTRDIFF_MAX); 1099 static_assert (required * bits < PTRDIFF_MAX);
1101 for (ptrdiff_t i = 0; i < required; ++i) 1100 for (ptrdiff_t i = 0; i < required; ++i)
1102 magnitude[i] = (emacs_limb_t) (u >> (i * bits)); 1101 magnitude[i] = (emacs_limb_t) (u >> (i * bits));
1103 MODULE_INTERNAL_CLEANUP (); 1102 MODULE_INTERNAL_CLEANUP ();
diff --git a/src/eval.c b/src/eval.c
index 2161ab1e1ea..41003bd99f5 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1267,7 +1267,7 @@ usage: (catch TAG BODY...) */)
1267 eassert (E) when E contains variables that might be clobbered by a 1267 eassert (E) when E contains variables that might be clobbered by a
1268 longjmp. */ 1268 longjmp. */
1269 1269
1270#define clobbered_eassert(E) verify (sizeof (E) != 0) 1270#define clobbered_eassert(E) static_assert (sizeof (E) != 0)
1271 1271
1272void 1272void
1273pop_handler (void) 1273pop_handler (void)
diff --git a/src/fileio.c b/src/fileio.c
index fa280f2db00..6918bea8c9d 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -3906,7 +3906,7 @@ union read_non_regular
3906 } s; 3906 } s;
3907 GCALIGNED_UNION_MEMBER 3907 GCALIGNED_UNION_MEMBER
3908}; 3908};
3909verify (GCALIGNED (union read_non_regular)); 3909static_assert (GCALIGNED (union read_non_regular));
3910 3910
3911static Lisp_Object 3911static Lisp_Object
3912read_non_regular (Lisp_Object state) 3912read_non_regular (Lisp_Object state)
@@ -6316,7 +6316,7 @@ A non-nil CURRENT-ONLY argument means save only current buffer. */)
6316 continue; 6316 continue;
6317 6317
6318 enum { growth_factor = 4 }; 6318 enum { growth_factor = 4 };
6319 verify (BUF_BYTES_MAX <= EMACS_INT_MAX / growth_factor); 6319 static_assert (BUF_BYTES_MAX <= EMACS_INT_MAX / growth_factor);
6320 6320
6321 set_buffer_internal (b); 6321 set_buffer_internal (b);
6322 if (NILP (Vauto_save_include_big_deletions) 6322 if (NILP (Vauto_save_include_big_deletions)
diff --git a/src/fns.c b/src/fns.c
index c788ea54ec7..373a7dceb81 100644
--- a/src/fns.c
+++ b/src/fns.c
@@ -4631,7 +4631,7 @@ check_hash_table (Lisp_Object obj)
4631EMACS_INT 4631EMACS_INT
4632next_almost_prime (EMACS_INT n) 4632next_almost_prime (EMACS_INT n)
4633{ 4633{
4634 verify (NEXT_ALMOST_PRIME_LIMIT == 11); 4634 static_assert (NEXT_ALMOST_PRIME_LIMIT == 11);
4635 for (n |= 1; ; n += 2) 4635 for (n |= 1; ; n += 2)
4636 if (n % 3 != 0 && n % 5 != 0 && n % 7 != 0) 4636 if (n % 3 != 0 && n % 5 != 0 && n % 7 != 0)
4637 return n; 4637 return n;
@@ -5391,7 +5391,7 @@ hash_string (char const *ptr, ptrdiff_t len)
5391 /* String is shorter than an EMACS_UINT. Use smaller loads. */ 5391 /* String is shorter than an EMACS_UINT. Use smaller loads. */
5392 eassume (p <= end && end - p < sizeof (EMACS_UINT)); 5392 eassume (p <= end && end - p < sizeof (EMACS_UINT));
5393 EMACS_UINT tail = 0; 5393 EMACS_UINT tail = 0;
5394 verify (sizeof tail <= 8); 5394 static_assert (sizeof tail <= 8);
5395#if EMACS_INT_MAX > INT32_MAX 5395#if EMACS_INT_MAX > INT32_MAX
5396 if (end - p >= 4) 5396 if (end - p >= 4)
5397 { 5397 {
diff --git a/src/fringe.c b/src/fringe.c
index 0642de5f772..181e613ce55 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1813,7 +1813,7 @@ init_fringe (void)
1813 1813
1814 fringe_bitmaps = xzalloc (max_fringe_bitmaps * sizeof *fringe_bitmaps); 1814 fringe_bitmaps = xzalloc (max_fringe_bitmaps * sizeof *fringe_bitmaps);
1815 1815
1816 verify (NIL_IS_ZERO); 1816 static_assert (NIL_IS_ZERO);
1817 fringe_faces = xzalloc (max_fringe_bitmaps * sizeof *fringe_faces); 1817 fringe_faces = xzalloc (max_fringe_bitmaps * sizeof *fringe_faces);
1818} 1818}
1819 1819
diff --git a/src/keyboard.h b/src/keyboard.h
index c7ae1f7f0fa..387501c9f88 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -497,8 +497,8 @@ INLINE void
497kbd_buffer_store_event_hold (struct input_event *event, 497kbd_buffer_store_event_hold (struct input_event *event,
498 struct input_event *hold_quit) 498 struct input_event *hold_quit)
499{ 499{
500 verify (alignof (struct input_event) == alignof (union buffered_input_event) 500 static_assert (alignof (struct input_event) == alignof (union buffered_input_event)
501 && sizeof (struct input_event) == sizeof (union buffered_input_event)); 501 && sizeof (struct input_event) == sizeof (union buffered_input_event));
502 kbd_buffer_store_buffered_event ((union buffered_input_event *) event, 502 kbd_buffer_store_buffered_event ((union buffered_input_event *) event,
503 hold_quit); 503 hold_quit);
504} 504}
diff --git a/src/keymap.c b/src/keymap.c
index f2a7e4006c3..7249d8252f9 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -518,7 +518,7 @@ union map_keymap
518 } s; 518 } s;
519 GCALIGNED_UNION_MEMBER 519 GCALIGNED_UNION_MEMBER
520}; 520};
521verify (GCALIGNED (union map_keymap)); 521static_assert (GCALIGNED (union map_keymap));
522 522
523static void 523static void
524map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val) 524map_keymap_char_table_item (Lisp_Object args, Lisp_Object key, Lisp_Object val)
diff --git a/src/lisp.h b/src/lisp.h
index 976b7a15251..e9836a2211b 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -140,7 +140,7 @@ typedef unsigned char bits_word;
140# define BITS_WORD_MAX ((1u << BOOL_VECTOR_BITS_PER_CHAR) - 1) 140# define BITS_WORD_MAX ((1u << BOOL_VECTOR_BITS_PER_CHAR) - 1)
141enum { BITS_PER_BITS_WORD = BOOL_VECTOR_BITS_PER_CHAR }; 141enum { BITS_PER_BITS_WORD = BOOL_VECTOR_BITS_PER_CHAR };
142#endif 142#endif
143verify (BITS_WORD_MAX >> (BITS_PER_BITS_WORD - 1) == 1); 143static_assert (BITS_WORD_MAX >> (BITS_PER_BITS_WORD - 1) == 1);
144 144
145/* Use pD to format ptrdiff_t values, which suffice for indexes into 145/* Use pD to format ptrdiff_t values, which suffice for indexes into
146 buffers and strings. Emacs never allocates objects larger than 146 buffers and strings. Emacs never allocates objects larger than
@@ -281,14 +281,14 @@ DEFINE_GDB_SYMBOL_END (VALMASK)
281 emacs_align_type union in alloc.c. 281 emacs_align_type union in alloc.c.
282 282
283 Although these macros are reasonably portable, they are not 283 Although these macros are reasonably portable, they are not
284 guaranteed on non-GCC platforms, as the C standard does not require support 284 guaranteed on non-GCC platforms, as the C standard does not require
285 for alignment to GCALIGNMENT and older compilers may ignore 285 support for alignment to GCALIGNMENT and older compilers may ignore
286 alignment requests. For any type T where garbage collection 286 alignment requests. For any type T where garbage collection requires
287 requires alignment, use verify (GCALIGNED (T)) to verify the 287 alignment, use static_assert (GCALIGNED (T)) to verify the
288 requirement on the current platform. Types need this check if 288 requirement on the current platform. Types need this check if their
289 their objects can be allocated outside the garbage collector. For 289 objects can be allocated outside the garbage collector. For example,
290 example, struct Lisp_Symbol needs the check because of lispsym and 290 struct Lisp_Symbol needs the check because of lispsym and struct
291 struct Lisp_Cons needs it because of STACK_CONS. */ 291 Lisp_Cons needs it because of STACK_CONS. */
292 292
293#define GCALIGNED_UNION_MEMBER char alignas (GCALIGNMENT) gcaligned; 293#define GCALIGNED_UNION_MEMBER char alignas (GCALIGNMENT) gcaligned;
294#if HAVE_STRUCT_ATTRIBUTE_ALIGNED 294#if HAVE_STRUCT_ATTRIBUTE_ALIGNED
@@ -865,7 +865,7 @@ struct Lisp_Symbol
865 GCALIGNED_UNION_MEMBER 865 GCALIGNED_UNION_MEMBER
866 } u; 866 } u;
867}; 867};
868verify (GCALIGNED (struct Lisp_Symbol)); 868static_assert (GCALIGNED (struct Lisp_Symbol));
869 869
870/* Declare a Lisp-callable function. The MAXARGS parameter has the same 870/* Declare a Lisp-callable function. The MAXARGS parameter has the same
871 meaning as in the DEFUN macro, and is used to construct a prototype. */ 871 meaning as in the DEFUN macro, and is used to construct a prototype. */
@@ -1480,7 +1480,7 @@ struct Lisp_Cons
1480 GCALIGNED_UNION_MEMBER 1480 GCALIGNED_UNION_MEMBER
1481 } u; 1481 } u;
1482}; 1482};
1483verify (GCALIGNED (struct Lisp_Cons)); 1483static_assert (GCALIGNED (struct Lisp_Cons));
1484 1484
1485INLINE bool 1485INLINE bool
1486(NILP) (Lisp_Object x) 1486(NILP) (Lisp_Object x)
@@ -1610,7 +1610,7 @@ struct Lisp_String
1610 GCALIGNED_UNION_MEMBER 1610 GCALIGNED_UNION_MEMBER
1611 } u; 1611 } u;
1612}; 1612};
1613verify (GCALIGNED (struct Lisp_String)); 1613static_assert (GCALIGNED (struct Lisp_String));
1614 1614
1615INLINE bool 1615INLINE bool
1616STRINGP (Lisp_Object x) 1616STRINGP (Lisp_Object x)
@@ -2025,10 +2025,11 @@ gc_aset (Lisp_Object array, ptrdiff_t idx, Lisp_Object val)
2025} 2025}
2026 2026
2027/* True, since Qnil's representation is zero. Every place in the code 2027/* True, since Qnil's representation is zero. Every place in the code
2028 that assumes Qnil is zero should verify (NIL_IS_ZERO), to make it easy 2028 that assumes Qnil is zero should static_assert (NIL_IS_ZERO), to make
2029 to find such assumptions later if we change Qnil to be nonzero. 2029 it easy to find such assumptions later if we change Qnil to be
2030 Test iQnil and Lisp_Symbol instead of Qnil directly, since the latter 2030 nonzero. Test iQnil and Lisp_Symbol instead of Qnil directly, since
2031 is not suitable for use in an integer constant expression. */ 2031 the latter is not suitable for use in an integer constant
2032 expression. */
2032enum { NIL_IS_ZERO = iQnil == 0 && Lisp_Symbol == 0 }; 2033enum { NIL_IS_ZERO = iQnil == 0 && Lisp_Symbol == 0 };
2033 2034
2034/* Clear the object addressed by P, with size NBYTES, so that all its 2035/* Clear the object addressed by P, with size NBYTES, so that all its
@@ -2037,7 +2038,7 @@ INLINE void
2037memclear (void *p, ptrdiff_t nbytes) 2038memclear (void *p, ptrdiff_t nbytes)
2038{ 2039{
2039 eassert (0 <= nbytes); 2040 eassert (0 <= nbytes);
2040 verify (NIL_IS_ZERO); 2041 static_assert (NIL_IS_ZERO);
2041 /* Since Qnil is zero, memset suffices. */ 2042 /* Since Qnil is zero, memset suffices. */
2042 memset (p, 0, nbytes); 2043 memset (p, 0, nbytes);
2043} 2044}
@@ -2240,7 +2241,7 @@ union Aligned_Lisp_Subr
2240 struct Lisp_Subr s; 2241 struct Lisp_Subr s;
2241 GCALIGNED_UNION_MEMBER 2242 GCALIGNED_UNION_MEMBER
2242 }; 2243 };
2243verify (GCALIGNED (union Aligned_Lisp_Subr)); 2244static_assert (GCALIGNED (union Aligned_Lisp_Subr));
2244 2245
2245INLINE bool 2246INLINE bool
2246SUBRP (Lisp_Object a) 2247SUBRP (Lisp_Object a)
@@ -2281,11 +2282,11 @@ enum char_table_specials
2281 }; 2282 };
2282 2283
2283/* Sanity-check pseudovector layout. */ 2284/* Sanity-check pseudovector layout. */
2284verify (offsetof (struct Lisp_Char_Table, defalt) == header_size); 2285static_assert (offsetof (struct Lisp_Char_Table, defalt) == header_size);
2285verify (offsetof (struct Lisp_Char_Table, extras) 2286static_assert (offsetof (struct Lisp_Char_Table, extras)
2286 == header_size + CHAR_TABLE_STANDARD_SLOTS * sizeof (Lisp_Object)); 2287 == header_size + CHAR_TABLE_STANDARD_SLOTS * sizeof (Lisp_Object));
2287verify (offsetof (struct Lisp_Sub_Char_Table, contents) 2288static_assert (offsetof (struct Lisp_Sub_Char_Table, contents)
2288 == header_size + SUB_CHAR_TABLE_OFFSET * sizeof (Lisp_Object)); 2289 == header_size + SUB_CHAR_TABLE_OFFSET * sizeof (Lisp_Object));
2289 2290
2290/* Return the number of "extra" slots in the char table CT. */ 2291/* Return the number of "extra" slots in the char table CT. */
2291 2292
@@ -2819,7 +2820,7 @@ SXHASH_REDUCE (EMACS_UINT x)
2819INLINE hash_hash_t 2820INLINE hash_hash_t
2820reduce_emacs_uint_to_hash_hash (EMACS_UINT x) 2821reduce_emacs_uint_to_hash_hash (EMACS_UINT x)
2821{ 2822{
2822 verify (sizeof x <= 2 * sizeof (hash_hash_t)); 2823 static_assert (sizeof x <= 2 * sizeof (hash_hash_t));
2823 return (sizeof x == sizeof (hash_hash_t) 2824 return (sizeof x == sizeof (hash_hash_t)
2824 ? x 2825 ? x
2825 : x ^ (x >> (8 * (sizeof x - sizeof (hash_hash_t))))); 2826 : x ^ (x >> (8 * (sizeof x - sizeof (hash_hash_t)))));
@@ -3214,7 +3215,7 @@ struct Lisp_Float
3214 GCALIGNED_UNION_MEMBER 3215 GCALIGNED_UNION_MEMBER
3215 } u; 3216 } u;
3216 }; 3217 };
3217verify (GCALIGNED (struct Lisp_Float)); 3218static_assert (GCALIGNED (struct Lisp_Float));
3218 3219
3219INLINE bool 3220INLINE bool
3220(FLOATP) (Lisp_Object x) 3221(FLOATP) (Lisp_Object x)
@@ -4204,7 +4205,7 @@ modiff_incr (modiff_count *a, ptrdiff_t len)
4204 /* Increase the counter more for a large modification and less for a 4205 /* Increase the counter more for a large modification and less for a
4205 small modification. Increase it logarithmically to avoid 4206 small modification. Increase it logarithmically to avoid
4206 increasing it too much. */ 4207 increasing it too much. */
4207 verify (PTRDIFF_MAX <= ULLONG_MAX); 4208 static_assert (PTRDIFF_MAX <= ULLONG_MAX);
4208 int incr = len == 0 ? 1 : elogb (len) + 1; 4209 int incr = len == 0 ? 1 : elogb (len) + 1;
4209 bool modiff_overflow = ckd_add (a, a0, incr); 4210 bool modiff_overflow = ckd_add (a, a0, incr);
4210 eassert (!modiff_overflow && *a >> 30 >> 30 == 0); 4211 eassert (!modiff_overflow && *a >> 30 >> 30 == 0);
@@ -4344,7 +4345,7 @@ extern void tim_sort (Lisp_Object, Lisp_Object, Lisp_Object *, const ptrdiff_t,
4344 ARG_NONNULL ((3)); 4345 ARG_NONNULL ((3));
4345 4346
4346/* Defined in floatfns.c. */ 4347/* Defined in floatfns.c. */
4347verify (FLT_RADIX == 2 || FLT_RADIX == 16); 4348static_assert (FLT_RADIX == 2 || FLT_RADIX == 16);
4348enum { LOG2_FLT_RADIX = FLT_RADIX == 2 ? 1 : 4 }; 4349enum { LOG2_FLT_RADIX = FLT_RADIX == 2 ? 1 : 4 };
4349int double_integer_scale (double); 4350int double_integer_scale (double);
4350#ifndef HAVE_TRUNC 4351#ifndef HAVE_TRUNC
diff --git a/src/lread.c b/src/lread.c
index ace7abd80c8..08b8765a6f7 100644
--- a/src/lread.c
+++ b/src/lread.c
@@ -3646,7 +3646,7 @@ skip_lazy_string (Lisp_Object readcharfun)
3646 and record where in the file it comes from. */ 3646 and record where in the file it comes from. */
3647 3647
3648 /* First exchange the two saved_strings. */ 3648 /* First exchange the two saved_strings. */
3649 verify (ARRAYELTS (saved_strings) == 2); 3649 static_assert (ARRAYELTS (saved_strings) == 2);
3650 struct saved_string t = saved_strings[0]; 3650 struct saved_string t = saved_strings[0];
3651 saved_strings[0] = saved_strings[1]; 3651 saved_strings[0] = saved_strings[1];
3652 saved_strings[1] = t; 3652 saved_strings[1] = t;
diff --git a/src/nsgui.h b/src/nsgui.h
index de679075d2b..71bae41b9da 100644
--- a/src/nsgui.h
+++ b/src/nsgui.h
@@ -29,8 +29,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
29#define Cursor FooFoo 29#define Cursor FooFoo
30#endif /* NS_IMPL_COCOA */ 30#endif /* NS_IMPL_COCOA */
31 31
32#undef verify
33
34#import <AppKit/AppKit.h> 32#import <AppKit/AppKit.h>
35 33
36#ifdef NS_IMPL_COCOA 34#ifdef NS_IMPL_COCOA
@@ -44,10 +42,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
44 42
45#endif /* __OBJC__ */ 43#endif /* __OBJC__ */
46 44
47#undef verify
48#undef _GL_VERIFY_H
49#include <verify.h>
50
51/* Emulate XCharStruct. */ 45/* Emulate XCharStruct. */
52typedef struct _XCharStruct 46typedef struct _XCharStruct
53{ 47{
diff --git a/src/pdumper.c b/src/pdumper.c
index 53bddf91f04..5f64d68e9d7 100644
--- a/src/pdumper.c
+++ b/src/pdumper.c
@@ -99,11 +99,11 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
99 are the same size and have the same layout, and where bytes have 99 are the same size and have the same layout, and where bytes have
100 eight bits --- that is, a general-purpose computer made after 1990. 100 eight bits --- that is, a general-purpose computer made after 1990.
101 Also require Lisp_Object to be at least as wide as pointers. */ 101 Also require Lisp_Object to be at least as wide as pointers. */
102verify (sizeof (ptrdiff_t) == sizeof (void *)); 102static_assert (sizeof (ptrdiff_t) == sizeof (void *));
103verify (sizeof (intptr_t) == sizeof (ptrdiff_t)); 103static_assert (sizeof (intptr_t) == sizeof (ptrdiff_t));
104verify (sizeof (void (*) (void)) == sizeof (void *)); 104static_assert (sizeof (void (*) (void)) == sizeof (void *));
105verify (sizeof (ptrdiff_t) <= sizeof (Lisp_Object)); 105static_assert (sizeof (ptrdiff_t) <= sizeof (Lisp_Object));
106verify (sizeof (ptrdiff_t) <= sizeof (EMACS_INT)); 106static_assert (sizeof (ptrdiff_t) <= sizeof (EMACS_INT));
107 107
108static size_t 108static size_t
109divide_round_up (size_t x, size_t y) 109divide_round_up (size_t x, size_t y)
@@ -276,15 +276,15 @@ enum
276 DUMP_RELOC_OFFSET_BITS = DUMP_OFF_WIDTH - DUMP_RELOC_TYPE_BITS 276 DUMP_RELOC_OFFSET_BITS = DUMP_OFF_WIDTH - DUMP_RELOC_TYPE_BITS
277 }; 277 };
278 278
279verify (RELOC_DUMP_TO_EMACS_LV + 8 < (1 << DUMP_RELOC_TYPE_BITS)); 279static_assert (RELOC_DUMP_TO_EMACS_LV + 8 < (1 << DUMP_RELOC_TYPE_BITS));
280verify (DUMP_ALIGNMENT >= GCALIGNMENT); 280static_assert (DUMP_ALIGNMENT >= GCALIGNMENT);
281 281
282struct dump_reloc 282struct dump_reloc
283{ 283{
284 unsigned int raw_offset : DUMP_RELOC_OFFSET_BITS; 284 unsigned int raw_offset : DUMP_RELOC_OFFSET_BITS;
285 ENUM_BF (dump_reloc_type) type : DUMP_RELOC_TYPE_BITS; 285 ENUM_BF (dump_reloc_type) type : DUMP_RELOC_TYPE_BITS;
286}; 286};
287verify (sizeof (struct dump_reloc) == sizeof (dump_off)); 287static_assert (sizeof (struct dump_reloc) == sizeof (dump_off));
288 288
289/* Set the type of a dump relocation. 289/* Set the type of a dump relocation.
290 290
@@ -2244,7 +2244,7 @@ dump_bignum (struct dump_context *ctx, Lisp_Object object)
2244#endif 2244#endif
2245 const struct Lisp_Bignum *bignum = XBIGNUM (object); 2245 const struct Lisp_Bignum *bignum = XBIGNUM (object);
2246 START_DUMP_PVEC (ctx, &bignum->header, struct Lisp_Bignum, out); 2246 START_DUMP_PVEC (ctx, &bignum->header, struct Lisp_Bignum, out);
2247 verify (sizeof (out->value) >= sizeof (struct bignum_reload_info)); 2247 static_assert (sizeof (out->value) >= sizeof (struct bignum_reload_info));
2248 dump_field_fixup_later (ctx, out, bignum, xbignum_val (object)); 2248 dump_field_fixup_later (ctx, out, bignum, xbignum_val (object));
2249 dump_off bignum_offset = finish_dump_pvec (ctx, &out->header); 2249 dump_off bignum_offset = finish_dump_pvec (ctx, &out->header);
2250 if (ctx->flags.dump_object_contents) 2250 if (ctx->flags.dump_object_contents)
@@ -4248,11 +4248,11 @@ types. */)
4248 O_RDWR | O_TRUNC | O_CREAT, 0666); 4248 O_RDWR | O_TRUNC | O_CREAT, 0666);
4249 if (ctx->fd < 0) 4249 if (ctx->fd < 0)
4250 report_file_error ("Opening dump output", filename); 4250 report_file_error ("Opening dump output", filename);
4251 verify (sizeof (ctx->header.magic) == sizeof (dump_magic)); 4251 static_assert (sizeof (ctx->header.magic) == sizeof (dump_magic));
4252 memcpy (&ctx->header.magic, dump_magic, sizeof (dump_magic)); 4252 memcpy (&ctx->header.magic, dump_magic, sizeof (dump_magic));
4253 ctx->header.magic[0] = '!'; /* Note that dump is incomplete. */ 4253 ctx->header.magic[0] = '!'; /* Note that dump is incomplete. */
4254 4254
4255 verify (sizeof (fingerprint) == sizeof (ctx->header.fingerprint)); 4255 static_assert (sizeof (fingerprint) == sizeof (ctx->header.fingerprint));
4256 for (int i = 0; i < sizeof fingerprint; i++) 4256 for (int i = 0; i < sizeof fingerprint; i++)
4257 ctx->header.fingerprint[i] = fingerprint[i]; 4257 ctx->header.fingerprint[i] = fingerprint[i];
4258 4258
@@ -5522,7 +5522,7 @@ dump_do_dump_relocation (const uintptr_t dump_base,
5522 { 5522 {
5523 struct Lisp_Bignum *bignum = dump_ptr (dump_base, reloc_offset); 5523 struct Lisp_Bignum *bignum = dump_ptr (dump_base, reloc_offset);
5524 struct bignum_reload_info reload_info; 5524 struct bignum_reload_info reload_info;
5525 verify (sizeof (reload_info) <= sizeof (*bignum_val (bignum))); 5525 static_assert (sizeof (reload_info) <= sizeof (*bignum_val (bignum)));
5526 memcpy (&reload_info, bignum_val (bignum), sizeof (reload_info)); 5526 memcpy (&reload_info, bignum_val (bignum), sizeof (reload_info));
5527 const mp_limb_t *limbs = 5527 const mp_limb_t *limbs =
5528 dump_ptr (dump_base, reload_info.data_location); 5528 dump_ptr (dump_base, reload_info.data_location);
@@ -5713,7 +5713,7 @@ pdumper_load (const char *dump_filename, char *argv0)
5713 } 5713 }
5714 5714
5715 err = PDUMPER_LOAD_VERSION_MISMATCH; 5715 err = PDUMPER_LOAD_VERSION_MISMATCH;
5716 verify (sizeof (header->fingerprint) == sizeof (fingerprint)); 5716 static_assert (sizeof (header->fingerprint) == sizeof (fingerprint));
5717 unsigned char desired[sizeof fingerprint]; 5717 unsigned char desired[sizeof fingerprint];
5718 for (int i = 0; i < sizeof fingerprint; i++) 5718 for (int i = 0; i < sizeof fingerprint; i++)
5719 desired[i] = fingerprint[i]; 5719 desired[i] = fingerprint[i];
diff --git a/src/process.c b/src/process.c
index 93178eb241f..6fc1ef8325f 100644
--- a/src/process.c
+++ b/src/process.c
@@ -95,7 +95,6 @@ static struct rlimit nofile_limit;
95#include <flexmember.h> 95#include <flexmember.h>
96#include <nproc.h> 96#include <nproc.h>
97#include <sig2str.h> 97#include <sig2str.h>
98#include <verify.h>
99 98
100#endif /* subprocesses */ 99#endif /* subprocesses */
101 100
@@ -922,7 +921,7 @@ make_process (Lisp_Object name)
922 p->open_fd[i] = -1; 921 p->open_fd[i] = -1;
923 922
924#ifdef HAVE_GNUTLS 923#ifdef HAVE_GNUTLS
925 verify (GNUTLS_STAGE_EMPTY == 0); 924 static_assert (GNUTLS_STAGE_EMPTY == 0);
926 eassert (p->gnutls_initstage == GNUTLS_STAGE_EMPTY); 925 eassert (p->gnutls_initstage == GNUTLS_STAGE_EMPTY);
927 eassert (NILP (p->gnutls_boot_parameters)); 926 eassert (NILP (p->gnutls_boot_parameters));
928#endif 927#endif
@@ -1913,7 +1912,7 @@ usage: (make-process &rest ARGS) */)
1913 1912
1914#ifdef HAVE_GNUTLS 1913#ifdef HAVE_GNUTLS
1915 /* AKA GNUTLS_INITSTAGE(proc). */ 1914 /* AKA GNUTLS_INITSTAGE(proc). */
1916 verify (GNUTLS_STAGE_EMPTY == 0); 1915 static_assert (GNUTLS_STAGE_EMPTY == 0);
1917 eassert (XPROCESS (proc)->gnutls_initstage == GNUTLS_STAGE_EMPTY); 1916 eassert (XPROCESS (proc)->gnutls_initstage == GNUTLS_STAGE_EMPTY);
1918 eassert (NILP (XPROCESS (proc)->gnutls_cred_type)); 1917 eassert (NILP (XPROCESS (proc)->gnutls_cred_type));
1919#endif 1918#endif
@@ -2143,7 +2142,7 @@ enum
2143 EXEC_MONITOR_OUTPUT 2142 EXEC_MONITOR_OUTPUT
2144 }; 2143 };
2145 2144
2146verify (PROCESS_OPEN_FDS == EXEC_MONITOR_OUTPUT + 1); 2145static_assert (PROCESS_OPEN_FDS == EXEC_MONITOR_OUTPUT + 1);
2147 2146
2148static void 2147static void
2149create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir) 2148create_process (Lisp_Object process, char **new_argv, Lisp_Object current_dir)
@@ -3540,9 +3539,9 @@ connect_network_socket (Lisp_Object proc, Lisp_Object addrinfos,
3540 structures, but the standards don't guarantee that, 3539 structures, but the standards don't guarantee that,
3541 so verify it here. */ 3540 so verify it here. */
3542 struct sockaddr_in6 sa6; 3541 struct sockaddr_in6 sa6;
3543 verify ((offsetof (struct sockaddr_in, sin_port) 3542 static_assert ((offsetof (struct sockaddr_in, sin_port)
3544 == offsetof (struct sockaddr_in6, sin6_port)) 3543 == offsetof (struct sockaddr_in6, sin6_port))
3545 && sizeof (sa1.sin_port) == sizeof (sa6.sin6_port)); 3544 && sizeof (sa1.sin_port) == sizeof (sa6.sin6_port));
3546#endif 3545#endif
3547 DECLARE_POINTER_ALIAS (psa1, struct sockaddr, &sa1); 3546 DECLARE_POINTER_ALIAS (psa1, struct sockaddr, &sa1);
3548 if (getsockname (s, psa1, &len1) == 0) 3547 if (getsockname (s, psa1, &len1) == 0)
diff --git a/src/regex-emacs.c b/src/regex-emacs.c
index 92dbdbecbf1..3bf3ad9c93b 100644
--- a/src/regex-emacs.c
+++ b/src/regex-emacs.c
@@ -1290,7 +1290,7 @@ typedef int regnum_t;
1290/* Macros for the compile stack. */ 1290/* Macros for the compile stack. */
1291 1291
1292typedef long pattern_offset_t; 1292typedef long pattern_offset_t;
1293verify (LONG_MIN <= -(MAX_BUF_SIZE - 1) && MAX_BUF_SIZE - 1 <= LONG_MAX); 1293static_assert (LONG_MIN <= -(MAX_BUF_SIZE - 1) && MAX_BUF_SIZE - 1 <= LONG_MAX);
1294 1294
1295typedef struct 1295typedef struct
1296{ 1296{
diff --git a/src/sort.c b/src/sort.c
index 24c3e94f50c..0bf51da5aff 100644
--- a/src/sort.c
+++ b/src/sort.c
@@ -1113,7 +1113,7 @@ tim_sort (Lisp_Object predicate, Lisp_Object keyfunc,
1113 { 1113 {
1114 /* Fill with valid Lisp values in case a GC occurs before all 1114 /* Fill with valid Lisp values in case a GC occurs before all
1115 keys have been computed. */ 1115 keys have been computed. */
1116 verify (NIL_IS_ZERO); 1116 static_assert (NIL_IS_ZERO);
1117 keys = allocated_keys = xzalloc (length * word_size); 1117 keys = allocated_keys = xzalloc (length * word_size);
1118 } 1118 }
1119 1119
diff --git a/src/sysdep.c b/src/sysdep.c
index d916a695155..b19a8368aec 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -2248,7 +2248,7 @@ init_random (void)
2248 /* FIXME: Perhaps getrandom can be used here too? */ 2248 /* FIXME: Perhaps getrandom can be used here too? */
2249 success = w32_init_random (&v, sizeof v) == 0; 2249 success = w32_init_random (&v, sizeof v) == 0;
2250#else 2250#else
2251 verify (sizeof v <= 256); 2251 static_assert (sizeof v <= 256);
2252 success = getrandom (&v, sizeof v, 0) == sizeof v; 2252 success = getrandom (&v, sizeof v, 0) == sizeof v;
2253#endif 2253#endif
2254 2254
@@ -2742,16 +2742,16 @@ emacs_fchmodat (int fd, const char *path, mode_t mode, int flags)
2742#ifndef SSIZE_MAX 2742#ifndef SSIZE_MAX
2743# define SSIZE_MAX TYPE_MAXIMUM (ssize_t) 2743# define SSIZE_MAX TYPE_MAXIMUM (ssize_t)
2744#endif 2744#endif
2745verify (MAX_RW_COUNT <= PTRDIFF_MAX); 2745static_assert (MAX_RW_COUNT <= PTRDIFF_MAX);
2746verify (MAX_RW_COUNT <= SIZE_MAX); 2746static_assert (MAX_RW_COUNT <= SIZE_MAX);
2747verify (MAX_RW_COUNT <= SSIZE_MAX); 2747static_assert (MAX_RW_COUNT <= SSIZE_MAX);
2748 2748
2749#ifdef WINDOWSNT 2749#ifdef WINDOWSNT
2750/* Verify that Emacs read requests cannot cause trouble, even in 2750/* Verify that Emacs read requests cannot cause trouble, even in
2751 64-bit builds. The last argument of 'read' is 'unsigned int', and 2751 64-bit builds. The last argument of 'read' is 'unsigned int', and
2752 the return value's type (see 'sys_read') is 'int'. */ 2752 the return value's type (see 'sys_read') is 'int'. */
2753verify (MAX_RW_COUNT <= INT_MAX); 2753static_assert (MAX_RW_COUNT <= INT_MAX);
2754verify (MAX_RW_COUNT <= UINT_MAX); 2754static_assert (MAX_RW_COUNT <= UINT_MAX);
2755#endif 2755#endif
2756 2756
2757/* Read from FD to a buffer BUF with size NBYTE. 2757/* Read from FD to a buffer BUF with size NBYTE.
diff --git a/src/thread.c b/src/thread.c
index dd4ef870026..b7635e229e1 100644
--- a/src/thread.c
+++ b/src/thread.c
@@ -43,7 +43,7 @@ union aligned_thread_state
43 struct thread_state s; 43 struct thread_state s;
44 GCALIGNED_UNION_MEMBER 44 GCALIGNED_UNION_MEMBER
45}; 45};
46verify (GCALIGNED (union aligned_thread_state)); 46static_assert (GCALIGNED (union aligned_thread_state));
47 47
48static union aligned_thread_state main_thread 48static union aligned_thread_state main_thread
49 = {{ 49 = {{
diff --git a/src/timefns.c b/src/timefns.c
index 7d8ecd36407..86b2425dbe1 100644
--- a/src/timefns.c
+++ b/src/timefns.c
@@ -105,7 +105,7 @@ trillion_factor (Lisp_Object hz)
105 if (!FIXNUM_OVERFLOW_P (TRILLION)) 105 if (!FIXNUM_OVERFLOW_P (TRILLION))
106 return false; 106 return false;
107 } 107 }
108 verify (TRILLION <= INTMAX_MAX); 108 static_assert (TRILLION <= INTMAX_MAX);
109 intmax_t ihz; 109 intmax_t ihz;
110 return integer_to_intmax (hz, &ihz) && TRILLION % ihz == 0; 110 return integer_to_intmax (hz, &ihz) && TRILLION % ihz == 0;
111} 111}
diff --git a/src/unexelf.c b/src/unexelf.c
index a9a8f2d6ce9..4b109470066 100644
--- a/src/unexelf.c
+++ b/src/unexelf.c
@@ -181,10 +181,9 @@ typedef struct {
181/* The code often converts ElfW (Half) values like e_shentsize to ptrdiff_t; 181/* The code often converts ElfW (Half) values like e_shentsize to ptrdiff_t;
182 check that this doesn't lose information. */ 182 check that this doesn't lose information. */
183#include <intprops.h> 183#include <intprops.h>
184#include <verify.h> 184static_assert ((! TYPE_SIGNED (ElfW (Half))
185verify ((! TYPE_SIGNED (ElfW (Half)) 185 || PTRDIFF_MIN <= TYPE_MINIMUM (ElfW (Half)))
186 || PTRDIFF_MIN <= TYPE_MINIMUM (ElfW (Half))) 186 && TYPE_MAXIMUM (ElfW (Half)) <= PTRDIFF_MAX);
187 && TYPE_MAXIMUM (ElfW (Half)) <= PTRDIFF_MAX);
188 187
189#ifdef UNEXELF_DEBUG 188#ifdef UNEXELF_DEBUG
190# define DEBUG_LOG(expr) fprintf (stderr, #expr " 0x%"PRIxMAX"\n", \ 189# define DEBUG_LOG(expr) fprintf (stderr, #expr " 0x%"PRIxMAX"\n", \
diff --git a/src/xterm.c b/src/xterm.c
index 29f94dd196d..2396175ef3a 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -15585,7 +15585,7 @@ x_send_scroll_bar_event (Lisp_Object window, enum scroll_bar_part part,
15585 XClientMessageEvent *ev = &event.xclient; 15585 XClientMessageEvent *ev = &event.xclient;
15586 struct window *w = XWINDOW (window); 15586 struct window *w = XWINDOW (window);
15587 struct frame *f = XFRAME (w->frame); 15587 struct frame *f = XFRAME (w->frame);
15588 verify (INTPTR_WIDTH <= 64); 15588 static_assert (INTPTR_WIDTH <= 64);
15589 15589
15590 /* Don't do anything if too many scroll bar events have been 15590 /* Don't do anything if too many scroll bar events have been
15591 sent but not received. */ 15591 sent but not received. */