Yahoo Groups archive

Lpc2000

Index last updated: 2026-04-28 23:31 UTC

Message

Re: [lpc2000] Bit-fields are brain-dead (was Looking to buy compiler)

2005-11-09 by David Hawkins

Tom Walsh wrote:

>>So, I never used bit-fields again ...

Ok, So 'I never had a reason to use bit-fields since then' :)

> Bitfields are usefull for tearing apart bit-packed fields within data or 
> assembling it.  While you are correct in stating that use of a bitfield 
> against a register which expects a finite length operation (32 bit in 
> your case), it is not correct to condemn then out of hand just because 
> you had a bad experience.  "you burn you learn"...

Yes, this was definitely a learning experience - one I am sure
others will face - except perhaps for those reading this
thread.

Thanks for the pointers on legitimate uses of bit-fields.

Here's a question for you. What happens on different-endianness
machines regarding bit-fields? Eg. lets say you analyze FAT headers
(which was discussed a few emails back). If I recall correctly,
they used bitfields and packed structures.

Do the layouts of entries match on different endianness machines,
or do you have to be careful there too?


Cheers
Dave

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.