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

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=mNRqc/S0QrasE8PD0z3reXWBVfW5T/X4YBmSC83YVd3tTRsb8E9on
k3Zx6CA6+S1tcxgSRRFxuI9WD5S7tR7ySObCLnVjLvTLqnh60HnOqor+bkPsuQ7E
Pv2huEvLl6jltqFg9ULx9e0KIojevUtXGsN6bRROWxsek4KxY+NwtA=
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=Vf0GSYo5QurPX6XAzK+k2U76mNw=; b=WY5ryXpyU0YsB4wKTf+xC+iBe5/w
3H7cefrICRauInUMMZyIDeHhKLXQ3D9/tUOr6hrD5uX5VY94uh+J7SdB4r3hnEGT
1C1prERZnS/42mCCt4RduBeplwuIpA3DnRoHGvHM21Ux/nVy7yf1H4cSm4bxULLY
EvQDUbeAlfEapI0=
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.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,RCVD_IN_HOSTKARMA_YE autolearn=ham version=3.3.1
X-Mail-Handler: Dyn Standard SMTP by Dyn
X-Report-Abuse-To: abuse AT dyndns DOT com (see http://www.dyndns.com/services/sendlabs/outbound_abuse.html for abuse reporting information)
X-MHO-User: U2FsdGVkX1/yzztxgWb7wIleICxSOxsr
Date: Wed, 3 Jul 2013 15:15:40 -0400
From: Christopher Faylor <cgf-use-the-mailinglist-please AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: setup ChangeLog win32.h
Message-ID: <20130703191540.GE3182@ednor.casa.cgf.cx>
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>
MIME-Version: 1.0
In-Reply-To: <20130703123010.GE5118@calimero.vinschen.de>
User-Agent: Mutt/1.5.20 (2009-06-14)

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

- Raw text -


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