[sdiy] Pointers in C

Jay Vaughan jayv at synth.net
Mon Jan 2 09:47:10 CET 2012


Union aliases don't optimize access, they document usage. Can't make a union without structs as unions are a special form of struct in the first place..

;
--
seclorum 

On Jan 2, 2012, at 4:38, Phillip Harbison <alvitar at xavax.com> wrote:

> 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
> 
> _______________________________________________
> Synth-diy mailing list
> Synth-diy at dropmix.xs4all.nl
> http://dropmix.xs4all.nl/mailman/listinfo/synth-diy



More information about the Synth-diy mailing list