[Bug c/88662] Document trap representations of _Bool

gonzalobg88 at gmail dot com gcc-bugzilla@gcc.gnu.org
Wed Jan 2 14:40:00 GMT 2019


--- Comment #6 from gnzlbg <gonzalobg88 at gmail dot com> ---
> Why do you need more than that?

I'm reading raw data from a file which supposedly contains _Bool's and I'd like
to validate it (the _Bools could have been written to the file by a program
compiled with a different C toolchain). 

> You can copy the bit-pattern from any _Bool with true value,

The standard does not guarantee that only one such bit-pattern exists AFAICT,
i.e., there might be multiple bit-patterns representing true and false, e.g.,
if only the first bit is used to represent true and false, and all other bits
are ignored (e.g., as opposed to just being zero, like the SysV AMD64 ABI

More information about the Gcc-bugs mailing list