[sdiy] Pointers in C
Jay Vaughan
jayv at synth.net
Mon Jan 2 09:48:19 CET 2012
Is the goal sensible code that's easy to understand, or portability? In C these two concepts don't always align, pun intended. :)
;
--
seclorum
On Jan 2, 2012, at 5:28, Magnus Danielson <magnus at rubidium.dyndns.org> wrote:
> On 12/31/2011 06:19 PM, Jay Vaughan wrote:
>> Plus a union with bit field aliases is almost self documenting .. No thorny&/&& bugs to write.
>
> Last time I checked, bit fields in structs are not guaranteed to be interpreted in the same way for various architectures. You can get it to do "the right thing" for a particular architecture, but not necesserilly outside of that scope.
>
> So, it's a two-edged sword.
>
> Bit-masks, shift constants etc. is unfortunatly the only way to do portable stuff to match with protocols and hardware stuff.
>
> Cheers,
> Magnus
> _______________________________________________
> 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