Hi Keith
[Long time, no hear. ;-)]
Comments below.
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of Keith Gudger
> Sent: Tuesday, November 21, 2006 11:41 AM
> To: address@hidden
> Subject: [avr-gcc-list] Bit-wise structure and unions
>
> Below is a program which illustrates the following issue:
>
<snip>
> But I would rather not have the union. Is there any other way around
> this? Thanks.
>
Unfortunately, no. The union would be the standard solution.
Ok, I take that back but only slightly. Why use bit fields at all? They are
inherently non-portable between compilers (if they work, then you're lucky).
Inherently, bit fields are tied to an int, which on the avr port is a 16-bit
type. We're lucky in that you can get GCC to put them into an unsigned char.
But again, that's compiler dependent.