[sdiy] Pointers in C

Phillip Harbison alvitar at xavax.com
Mon Jan 2 04:38:36 CET 2012


On 2011/12/31 11:36 AM, Jay Vaughan wrote:
> Best thing is to use a union though - this will let you set
> up some aliases to individual parts of the word without
> arithmetic and pointer mess.


A struct documents your hardware and your intent, whether you
wrap it in a union or not. If you have a name for those three
8-bit ports, use those names in your struct. Wrapping it in a
union might allow you to optimize access, but I'm betting the
compiler doesn't need your help.

-- 
Phil Harbison




More information about the Synth-diy mailing list