(info "(gnulib) Compile-time Assertions") currently includes:
#define MAX_UNSIGNED_VAL(t) \
((T) verify_expr (0 < (T) -1, -1))
where the parameter and its uses disagree on letter case.
I attach a fix which also divides the broader @example into @groups.
Thanks,
--
Basil
>From 09ffc11ec5f96e643f7f4f4ef3c85ac89b340ee8 Mon Sep 17 00:00:00 2001
From: "Basil L. Contovounesios" <[email protected]>
Date: Thu, 20 Nov 2025 21:58:19 +0100
Subject: [PATCH] doc: Tweak verify.h example.
* doc/verify.texi (Compile-time Assertions): Fix typo and @group
paragraphs in example.
---
ChangeLog | 6 ++++++
doc/verify.texi | 18 +++++++++++++++---
2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a0b7257a1f..6979f3d939 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2025-12-04 Basil L. Contovounesios <[email protected]>
+
+ doc: Tweak verify.h example.
+ * doc/verify.texi (Compile-time Assertions): Fix typo and @group
+ paragraphs in example.
+
2025-12-04 Bruno Haible <[email protected]>
Rename some local variables.
diff --git a/doc/verify.texi b/doc/verify.texi
index 2a471135a8..0672b6df13 100644
--- a/doc/verify.texi
+++ b/doc/verify.texi
@@ -77,31 +77,44 @@ Compile-time Assertions
Here are some example uses of these macros.
@example
+@group
#include <verify.h>
#include <limits.h>
#include <time.h>
+@end group
+@group
/* Verify that time_t is an integer type. */
verify ((time_t) 1.5 == 1);
+@end group
+@group
/* Verify that time_t is no smaller than int. */
verify (sizeof (int) <= sizeof (time_t));
+@end group
+@group
/* Verify that time_t is signed. */
verify ((time_t) -1 < 0);
+@end group
+@group
/* Verify that time_t uses two's complement representation. */
verify (~ (time_t) -1 == 0);
+@end group
+@group
/* Return the maximum value of the integer type T,
verifying that T is an unsigned integer type.
The cast to (T) is outside the call to verify_expr
so that the result is of type T
even when T is narrower than unsigned int. */
#define MAX_UNSIGNED_VAL(t) \
- ((T) verify_expr (0 < (T) -1, -1))
+ ((t) verify_expr (0 < (t) -1, -1))
+@end group
+@group
/* Return T divided by CHAR_MAX + 1, where behavior is
undefined if T < 0. In the common case where CHAR_MAX
is 127 the compiler can therefore implement the division
@@ -113,6 +126,5 @@ Compile-time Assertions
assume (0 <= t);
return t / (CHAR_MAX + 1);
@}
-
-
+@end group
@end example
--
2.51.0