Collin Funk wrote:
> Both ISO C 23 § 5.2.4.2.1 and
> Annex E seem to say BOOL_WIDTH must be exactly 1.
I have no idea what the footnote "This value is exact." in § 5.2.4.2.1 means.
And Annex E is informational, not normative.
Therefore, I think, the grounds for claiming a clang bug are weak.
Bru
On 2/12/24 5:09 AM, Bruno Haible wrote:
> BOOL_WIDTH = 1, BOOL_MAX = 1
> with CC="gcc -std=gnu2x", but
> BOOL_WIDTH = 8, BOOL_MAX = 1
> with CC="clang -std=gnu2x" (for all clang version 14 ... 17).
Same results with GCC 14 and Clang 19.
> Apparently I had misinterpreted the meaning of BOOL_
ISO C 23 § E.(3)).
This patch fixes the compilation error.
2024-02-12 Bruno Haible
limits-h: Fix BOOL_MAX value.
* lib/limits.in.h (BOOL_MAX): Define to 1, not to 2^BOOL_WIDTH-1.
* tests/test-limits-h.c (main): Change expected value of BOOL_MAX.
diff --git a/lib/lim