Re: [dev] dwm bit fields conversion

From: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
Date: Mon, 8 Jul 2013 10:45:48 +0200

On Mon, Jul 08, 2013 at 09:47:10AM +0200, Kurt Van Dijck wrote:
> Hello,
>
> I just remembered this thing from an embedded 16bit CPU.
>
> Why would you do
> unsigned char XXX :1
> and not
> unsigned int XXX :1
>
> I think the latter may benefit code size (a tiny bit)
> because it avoids an integer promotion, at least on some platforms.

unsigned char is directly incorrect and a gnu extension. Bitfields must be
integers o bool (since c99). You can see it with 'gcc -std=c99 -pedantic'.

Best regards,
Received on Mon Jul 08 2013 - 10:45:48 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 08 2013 - 10:48:05 CEST