This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: setup ChangeLog win32.h
- From: Corinna Vinschen <corinna-cygwin at cygwin dot com>
- To: cygwin at cygwin dot com
- Date: Wed, 3 Jul 2013 21:48:11 +0200
- Subject: Re: setup ChangeLog win32.h
- References: <20130702161048 dot 12696 dot qmail at sourceware dot org> <CAKw7uVgUv1OU5h6-uuU=wwaNTuDHLin2WxAwHmFzLAxZoYbUCA at mail dot gmail dot com> <20130703123010 dot GE5118 at calimero dot vinschen dot de> <20130703191540 dot GE3182 at ednor dot casa dot cgf dot cx>
- Reply-to: cygwin at cygwin dot com
On Jul 3 15:15, Christopher Faylor wrote:
> 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)));
That's even better. Applied.
Corinna
--
Corinna Vinschen Please, send mails regarding Cygwin to
Cygwin Maintainer cygwin AT cygwin DOT com
Red Hat
--
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