[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: limits-h: Fix BOOL_MAX value
From: |
Collin Funk |
Subject: |
Re: limits-h: Fix BOOL_MAX value |
Date: |
Mon, 12 Feb 2024 06:48:35 -0800 |
User-agent: |
Mozilla Thunderbird |
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_WIDTH. (Cf.
> ISO C 23 § E.(3)).
Today I learned. I was under the impression that BOOL_WIDTH would be
the same as the underlying type (8-bit char for example). Am I
misreading or would this be a Clang bug? Both ISO C 23 § 5.2.4.2.1 and
Annex E seem to say BOOL_WIDTH must be exactly 1. That would also make
the previous definition correct. :)