From: Arnd Bergmann Subject: Re: [Patch 04/18] include/linux/logfs.h Date: Wed, 6 Jun 2007 14:42:29 +0200 Message-ID: <200706061442.31147.arnd@arndb.de> References: <20070603183845.GA8952@lazybastard.org> <1181119820.25232.434.camel@pmac.infradead.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Segher Boessenkool , Kyle Moffett , John Stoffel , Willy Tarreau , Evgeniy Polyakov , CaT , Ondrej Zajicek , linux-kernel@vger.kernel.org, Bill Davidsen , Jan Engelhardt , Thomas Gleixner , Dongjun Shin , Pekka Enberg , Albert Cahalan , linux-fsdevel@vger.kernel.org, linux-mtd@lists.infradead.org, Artem Bityutskiy , Sam Ravnborg , Jamie Lokier , Roland Dreier , =?iso-8859-15?q?J=F6rn_Engel?= , Pavel Machek , Ulisses Furquim , akpm@osdl.org, David Weinehall Return-path: Received: from moutng.kundenserver.de ([212.227.126.183]:52878 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752557AbXFFMms convert rfc822-to-8bit (ORCPT ); Wed, 6 Jun 2007 08:42:48 -0400 In-Reply-To: <1181119820.25232.434.camel@pmac.infradead.org> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Wednesday 06 June 2007, David Woodhouse wrote: > And if I had something like this (which is admittedly contrived, but > hardware people _do_ do stupid things to us): > =A0 =A0{ uint32_t, uint8_t, uint16_t, uint8_t, uint32_t, uint32_t } >=20 > With the 'packed' attribute the compiler would assume arbitrary > alignment of all the 32-bit integers. But in reality it's only necess= ary > for the uint16_t in the middle. A 'nopadding' attribute would deal wi= th > that correctly. I would argue that a newly invented 'nopadding' attribute should reject such a structure as invalid, because it should not let members be unaligned. Unfortunately, this also gets tricky if you consider struct { uint32_t a; uint64_t b; uint32_t c; }; which does have an unaligned member by default in i386, but not on any modern platform. Arnd <>< - To unsubscribe from this list: send the line "unsubscribe linux-fsdevel= " in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html