64-bit alignment problems.

Ken Murchison murch at andrew.cmu.edu
Mon Sep 17 13:47:59 EDT 2007


Andy Fiddaman wrote:
> On Mon, 17 Sep 2007, Ken Murchison wrote:
> ; Good point.  I'm wondering if we need the struct at all, and can just use a
> ; union.
> 
> You're right, I've just tested the following and it works fine:
> 
> #define ALIGNBUF(buf, size) \
>         union { \
>             bit64 align8; \
>             char buf[(size)]; \
>         } align8buf; \
>         char *buf = align8buf.buf


I didn't like the way that the macro looked in the code, so I just 
typedef'd it instead.  Here is my current patch.  If it works, I'll 
commit it.


-- 
Kenneth Murchison
Systems Programmer
Project Cyrus Developer/Maintainer
Carnegie Mellon University
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 64bit_alignment.diff
Type: text/x-patch
Size: 5080 bytes
Desc: not available
Url : http://lists.andrew.cmu.edu/pipermail/info-cyrus/attachments/20070917/cbec9498/attachment.bin 


More information about the Info-cyrus mailing list