On Wed, Jul 03, 2013 at 02:30:10PM +0200, Corinna Vinschen wrote: >On Jul 3 10:42, V??clav Zeman wrote: >> On 2 July 2013 18:10, wrote: >> > >> > CVSROOT: /cvs/cygwin-apps >> > Module name: setup >> > Changes by: XXXX 2013-07-02 16:10:48 >> > >> > Modified files: >> > . : ChangeLog win32.h >> > >> > Log message: >> > * win32.h (struct acl_t): Make sure struct is 4 byte aligned. >> > >> > Patches: >> > http://sourceware.org/cgi-bin/cvsweb.cgi/setup/ChangeLog.diff?cvsroot=cygwin-apps&r1=2.807&r2=2.808 >> > http://sourceware.org/cgi-bin/cvsweb.cgi/setup/win32.h.diff?cvsroot=cygwin-apps&r1=2.29&r2=2.30 >> > >> Why not using the union trick? >> >> struct acl_t { >> union { >> LONG __align; /* Make sure &acl is 4-byte aligned. */ >> ACL acl; >> }; >> char aclbuf[TOKEN_ACL_SIZE (7)]; >> }; >> >> Same effect, AFAIK, and no size overhead. > >Yep, done.
Shouldn't we really explicitly specify the alignment rather than just assuming that LONG is aligned? The below works. cgf RCS file: /cvs/cygwin-apps/setup/win32.h,v retrieving revision 2.31 diff -d -u -p -r2.31 win32.h --- win32.h 3 Jul 2013 12:30:04 -0000 2.31 +++ win32.h 3 Jul 2013 19:14:46 -0000 @@ -75,10 +75,7 @@ (cnt) * (sizeof (ACCESS_ALLOWED_ACE) + MAX_SID_LEN)) struct acl_t { - union { - LONG __align; /* Make sure &acl is 4-byte aligned. */ - ACL acl; - }; + ACL acl __attribute__ ((aligned (4))); -- Problem reports: http://cygwin.com/problems.html FAQ: http://cygwin.com/faq/ Documentation: http://cygwin.com/docs.html Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple