Re: enum bitfield

Eric Blake <[email protected]>
Newsgroups gmane.comp.gnu.m4.patches
Message-ID <[email protected]>
-----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             [email protected]
-----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-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.