https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88662

--- Comment #8 from gnzlbg <gonzalobg88 at gmail dot com> ---
> I think it should be sufficient to either mention which types have padding 
> bits,

I am not sure. An intrinsic that tells me that _Bool has 7 padding bits does
not provide me with any new information. The C standard guarantees that _Bool
has 1 value bit, so if `sizeof(_Bool)` returns N, then _Bool must have N *
CHAR_BITS - 1 padding bits AFAICT. 

My question is which values are those padding bits allowed to take, which is
unspecified in the C standard AFAICT. 

N1356 (http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1356.htm) stated:

> GCC defines it to have one value bit with the other bits being padding bits 
> and undefined behavior if you access a _Bool representation with any of the 
> padding bits having a nonzero value (such representations being trap 
> representations)

Documenting that this is how GCC defines the value that the padding bits in
_Bool are allowed to take would be an useful guarantee, even if the standard
does not require GCC to make this guarantee.

Reply via email to