[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: enum bitfield
From: |
Eric Blake |
Subject: |
Re: enum bitfield |
Date: |
Thu, 22 Nov 2007 14:23:42 -0700 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Eric Blake on 11/22/2007 1:51 PM:
>> input_type type : 8;
>
>> The enum bitfield is a GNU extension.
>
> Oh well. I didn't want input_block to be any bigger than it has to be, so
> I'll just use a char instead, or perhaps something similar to how
> bool_bitfield in m4.h is defined according to GCC vs. C89.
Or more precisely, since C99 6.7.2.1 para 4 states:
A bit-field shall have a type that is a qualified or unqualified version
of _Bool, signed int, unsigned int, or some other implementation-defined type.
and since gnulib already states that _Bool is unsatisfactory due to the
limitations of the replacement <stdbool.h>, that leaves signed int and
unsigned int as the only two types safe for portable use in bitfields.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHRfNd84KuGfSFAYARAkf9AKCNWn9OeSPFnlj3iz1pwq2J3o0BDQCg1Cxj
Vy28ueGE1n2d0R4QI3CthZs=
=WdWg
-----END PGP SIGNATURE-----