* m4/limits-h.m4 (gl_LIMITS_H): Test also for BOOL_MAX.
* lib/limits.in.h: Handle the case where BOOL_WIDTH is present and
BOOL_MAX is missing.
* doc/posix-headers/limits.texi: Mention the clang bug.
+2023-02-09 Bruno Haible <bruno@clisp.org>
+
+ limits-h: Work around a clang 15 bug.
+ * m4/limits-h.m4 (gl_LIMITS_H): Test also for BOOL_MAX.
+ * lib/limits.in.h: Handle the case where BOOL_WIDTH is present and
+ BOOL_MAX is missing.
+ * doc/posix-headers/limits.texi: Mention the clang bug.
+
2023-02-09 Bruno Haible <bruno@clisp.org>
Fix error in C++ mode on glibc systems (regression 2022-04-28).
The macros @code{BOOL_MAX} and @code{BOOL_WIDTH} are not defined on
some platforms:
glibc 2.32, many others.
+@item
+The macro @code{BOOL_MAX} is not defined with some compilers:
+clang 15.0.6.
@end itemize
Portability problems fixed by Gnulib module @code{gethostname}:
/* A GNU-like <limits.h>.
- Copyright 2016-2022 Free Software Foundation, Inc.
+ Copyright 2016-2023 Free Software Foundation, Inc.
This file is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
/* Macros specified by C2x. */
-#if (! defined BOOL_WIDTH \
- && (defined _GNU_SOURCE \
- || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__)))
-# define BOOL_MAX 1
-# define BOOL_WIDTH 1
+#if (defined _GNU_SOURCE \
+ || (defined __STDC_VERSION__ && 201710 < __STDC_VERSION__))
+# if ! defined BOOL_WIDTH
+# define BOOL_WIDTH 1
+# define BOOL_MAX 1
+# elif ! defined BOOL_MAX
+# define BOOL_MAX ((((1U << (BOOL_WIDTH - 1)) - 1) << 1) + 1)
+# endif
#endif
#endif /* _@GUARD_PREFIX@_LIMITS_H */
dnl Check whether limits.h has needed features.
-dnl Copyright 2016-2022 Free Software Foundation, Inc.
+dnl Copyright 2016-2023 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
int wb = WORD_BIT;
int ullw = ULLONG_WIDTH;
int bw = BOOL_WIDTH;
+ int bm = BOOL_MAX;
]])],
[gl_cv_header_limits_width=yes],
[gl_cv_header_limits_width=no])])