From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9289 invoked by alias); 2 Aug 2005 19:26:22 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 8394 invoked by uid 22791); 2 Aug 2005 19:26:08 -0000 Received: from rproxy.gmail.com (HELO rproxy.gmail.com) (64.233.170.198) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Tue, 02 Aug 2005 19:26:08 +0000 Received: by rproxy.gmail.com with SMTP id j1so1596954rnf for ; Tue, 02 Aug 2005 12:26:06 -0700 (PDT) Received: by 10.11.99.79 with SMTP id w79mr73466cwb; Tue, 02 Aug 2005 12:26:06 -0700 (PDT) Received: by 10.11.99.15 with HTTP; Tue, 2 Aug 2005 12:26:06 -0700 (PDT) Message-ID: <7f45d9390508021226ea16fc7@mail.gmail.com> Date: Tue, 02 Aug 2005 19:26:00 -0000 From: Shaun Jackman Reply-To: Shaun Jackman To: Paul Koning Subject: Re: memcpy to an unaligned address Cc: dave.korn@artimi.com, gcc@sources.redhat.com In-Reply-To: <17135.51003.705531.520575@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline References: <7f45d9390508021032aea5a61@mail.gmail.com> <7f45d93905080212136ecb0cbb@mail.gmail.com> <17135.51003.705531.520575@gargle.gargle.HOWL> X-SW-Source: 2005-08/txt/msg00076.txt.bz2 On 8/2/05, Paul Koning wrote: > One of the things that continues to baffle me (and my colleagues) is > the bizarre way in which attributes such as "packed" work when applied > to structs. >=20 > It would be natural to assume, as Shaun did, that marking a struct > "packed" (or, for that matter, "packed,aligned(2)") would apply that > attribute to the fields of the struct. This is exactly the behaviour suggested by the info docs: $ info gcc 'C Ext' 'Type Attr' ... Specifying this attribute for `struct' and `union' types is equivalent to specifying the `packed' attribute on each of the structure or union members. Cheers, Shaun