[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#491654: gcc-4.3: _Bool isn't wide enough.



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

-- 
No more blah, blah, blah!
		-- Kirk, "Miri", stardate 2713.6

Attachment: signature.asc
Description: Digital signature


Reply to: