Return-Path: X-Original-To: apmail-stdcxx-dev-archive@www.apache.org Delivered-To: apmail-stdcxx-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 40DDEDE08 for ; Sat, 15 Sep 2012 21:48:09 +0000 (UTC) Received: (qmail 37548 invoked by uid 500); 15 Sep 2012 21:48:09 -0000 Delivered-To: apmail-stdcxx-dev-archive@stdcxx.apache.org Received: (qmail 37506 invoked by uid 500); 15 Sep 2012 21:48:09 -0000 Mailing-List: contact dev-help@stdcxx.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@stdcxx.apache.org Delivered-To: mailing list dev@stdcxx.apache.org Received: (qmail 37489 invoked by uid 99); 15 Sep 2012 21:48:09 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Sep 2012 21:48:09 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [64.34.174.152] (HELO hates.ms) (64.34.174.152) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 15 Sep 2012 21:48:01 +0000 Received: from [192.168.1.200] (cpe-069-134-011-036.nc.res.rr.com [69.134.11.36]) by hates.ms (Postfix) with ESMTPSA id 973A945C1AB for ; Sat, 15 Sep 2012 21:47:40 +0000 (UTC) Message-ID: <5054F77C.9030406@hates.ms> Date: Sat, 15 Sep 2012 17:47:40 -0400 From: Liviu Nicoara User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:15.0) Gecko/20120907 Thunderbird/15.0.1 MIME-Version: 1.0 To: dev@stdcxx.apache.org Subject: Re: STDCXX-1066 [was: Re: STDCXX forks] References: <5054B4B1.8040502@hates.ms> <5054EBD1.2010802@hates.ms> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 9/15/12 5:19 PM, Stefan Teleman wrote: > On Sat, Sep 15, 2012 at 4:57 PM, Liviu Nicoara wrote: > >> Yes, but it restores the default packing, not an arbitrary one, potentially >> set by the user prior to including our headers. Say, the user sets 2, the >> default is 4 and we set 8. When we set it to default it goes back to 4, >> instead of the expected 2. Did I get this right? > > This is true, but leaving some arbirary pragma pack(N) (for N != 0) in > effect for the duration of a program, and expecting it to work sounds > like a very defective programming approach to me. It will certainly > not work on SPARC at all. if the program needs to pack something in a > certain specific way, it need to do so for that specific something > only. Otherwise the side-effects of globally setting a non-default > packing will destroy the program anyway. I merely wanted to point out that restoring the default packing is not the same as restoring the packing to the previous value in effect. Given this, I thought about an alternative way of forcing this alignment, e.g., via a union, aligned on an appropriate type. I see an advantage here in that most of the changes would occur where we define the 'primitive' mutex and condition wrappers, saving a few pre-processor conditionals and pragmas along the way. What do you think? Liviu