delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2013/07/03/15:48:28

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=xDE6hXF4mty/s1dMMjZ3cEarkwY/AgH+a+jkSmxw5yOoE1n0tFipO
txMOjWGFy/0eM1q/f/B/3cUSel2m3tZSw6OcbgZfPW/4zr25m4Viv6vldxdij1ME
PdT/wA5xVA2VCsCjOchQ2XbfwGb7PDaNxyx3+q3JH1Nr4B4hfWl8p4=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=GpPGvp8EAfG7IKYvE9meRAn4xPk=; b=NTSzgVTbOWjc4DwkaHk4yod0yiGO
YHSS6chO9kO2knwAL/TC0nBhI1FzTz1lPp/ef/omjj8SV+LhvZ/t0028tSLmt1fY
PzHAb7k53zGZaGzHMVxZ2BmcPJOAsInPt81Ki9D1KxYbt/o6f7mQMt4Tk0ZqiWDH
1t29BPvT1dAVRr4=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,TW_CG autolearn=ham version=3.3.1
Date: Wed, 3 Jul 2013 21:48:11 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: setup ChangeLog win32.h
Message-ID: <20130703194811.GB1705@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
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>
MIME-Version: 1.0
In-Reply-To: <20130703191540.GE3182@ednor.casa.cgf.cx>
User-Agent: Mutt/1.5.21 (2010-09-15)

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019