git: a76700665f67 - stable/15 - libc/tests: Add assertions for BOOL_WIDTH, BOOL_MAX, and BITINT_MAXWIDTH
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 31 Oct 2026 10:06:40 UTC
The branch stable/15 has been updated by kfv:
URL: https://cgit.FreeBSD.org/src/commit/?id=a76700665f67ef90cca44caeec12bac7d4d062e5
commit a76700665f67ef90cca44caeec12bac7d4d062e5
Author: Faraz Vahedi <kfv@FreeBSD.org>
AuthorDate: 2026-08-04 16:31:37 +0000
Commit: Faraz Vahedi <kfv@FreeBSD.org>
CommitDate: 2026-10-31 10:03:33 +0000
libc/tests: Add assertions for BOOL_WIDTH, BOOL_MAX, and BITINT_MAXWIDTH
Reviewed by: fuz
Approved by: fuz (mentor)
MFC after: 1 month
Pull Request: https://github.com/freebsd/freebsd-src/pull/2352
(cherry picked from commit b54dcb897a5fa66ff1013d0ea403ed8894e34b8a)
---
lib/libc/tests/gen/limits_test.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/lib/libc/tests/gen/limits_test.c b/lib/libc/tests/gen/limits_test.c
index 7324ef74319e..b6f6fb78fab8 100644
--- a/lib/libc/tests/gen/limits_test.c
+++ b/lib/libc/tests/gen/limits_test.c
@@ -27,6 +27,9 @@
__XSTRING(TYPE) "_MAX wrongly defined");
/* primitive types */
+static_assert(BOOL_WIDTH == 1, "BOOL_WIDTH wrongly defined");
+static_assert(BOOL_MAX == 1, "BOOL_MAX wrongly defined");
+
#ifdef __CHAR_UNSIGNED__
CHECK_UTYPE(char, CHAR);
#else
@@ -92,6 +95,9 @@ CHECK_UTYPE(uintmax_t, UINTMAX);
CHECK_UTYPE(uintptr_t, UINTPTR);
CHECK_UTYPE(size_t, SIZE);
+static_assert(BITINT_MAXWIDTH >= ULLONG_WIDTH,
+ "BITINT_MAXWIDTH wrongly defined");
+
/* dummy */
ATF_TC_WITHOUT_HEAD(dummy);
ATF_TC_BODY(dummy, tc) {}