On Mon, 26 Oct 2009, Rob Landley wrote:

... Also, in my experience _Bool is about as real-world useful as the bit field notation with the colons, and is really there to keep the language pedants and the c++ guys happy without actually accomplishing much. I've never seen it actually produce better code.

It can produce more readable, less error-prone C code though. We use hardware register definitions such as

typedef struct {
  unsigned int x : 8;
  unsigned int y : 8;
  unsigned int control_bit : 1;
  unsigned int dummy1  : 15;
} reg_foo;

at great length for the C definitions for the registers in our chips, and it really does avoid nasty errors that crop up when using shifting and masking.

Just another opinion.

/Ricard
--
Ricard Wolf Wanderlöf                           ricardw(at)axis.com
Axis Communications AB, Lund, Sweden            www.axis.com
Phone +46 46 272 2016                           Fax +46 46 13 61 30
_______________________________________________
uClibc mailing list
uClibc@uclibc.org
http://lists.busybox.net/mailman/listinfo/uclibc

Reply via email to