enum, bit fields, cpp...

Kenneth Almquist ka at hou3c.UUCP
Tue Feb 28 01:21:58 AEST 1984

The ANSI committee will have to do something about bit fields.  Currently,
the way to store a boolean in a single bit of storage is to say

	struct { int flag: 1; } var;

and only test var.flag against zero.  I don't think that you should expect

	typedef enum {False, True} bool;
	struct { bool flag : 1; } var;

to even compile, because compilers are currently required to only support
int bit fields.
					Kenneth Almquist

More information about the Comp.lang.c mailing list