close 491654
thanks dude
Hi Bastian,
The paragraph talks about how signed types need to map to unsigned
types, and then goes on to talk about _Bool and unsigned types. I
completely misread it as meaning that _Bool had to map to an unsigned
type. You're entirely correct here, sorry for the trouble.
Nick
Bastian Blank wrote:
On Sun, Jul 20, 2008 at 11:32:28PM -0700, Nick Lewycky wrote:
In C99, _Bool is required to map to one of the unsigned types (6.2.5/6).
Please quote the standard. I read something different there.
However, GCC rejects the following (admittedly unethical) snippet:
struct S7 {
_Bool D : 8;
} s7 = { 1 };
with the error:
unethical.c:2: error: width of `D' exceeds its type
Then read ยง6.2.5 2):
| An object declared as type _Bool is large enough to store the values 0
| and 1.
So it can store at most one bit of information, not 8 as requested.
Bastian
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]