Re: 64-bit alignment problems.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


----
Cyrus Home Page: http://cyrusimap.web.cmu.edu/
Cyrus Wiki/FAQ: http://cyrusimap.web.cmu.edu/twiki
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

[Index of Archives]     [Cyrus SASL]     [Squirrel Mail]     [Asterisk PBX]     [Video For Linux]     [Photo]     [Yosemite News]     [gtk]     [KDE]     [Gimp on Windows]     [Steve's Art]

  Powered by Linux