From owner-cvs-all Thu May 30 1:12:37 2002 Delivered-To: cvs-all@freebsd.org Received: from chiark.greenend.org.uk (chiark.greenend.org.uk [212.135.138.206]) by hub.freebsd.org (Postfix) with ESMTP id 4BCE437B405; Thu, 30 May 2002 01:12:26 -0700 (PDT) Received: from fanf by chiark.greenend.org.uk with local (Exim 3.12 #1) id 17DL2f-0003yI-00 (Debian); Thu, 30 May 2002 09:12:17 +0100 Date: Thu, 30 May 2002 09:12:17 +0100 From: Tony Finch To: Marcel Moolenaar Cc: Jens Schweikhardt , Garrett Wollman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys gpt.h Message-ID: <20020530091217.A10098@chiark.greenend.org.uk> References: <200205290258.g4T2wgF83137@freefall.freebsd.org> <9551.1022648961@critter.freebsd.dk> <20020529053653.GA306@dhcp01.pn.xcllnt.net> <20020529173621.B11817@chiark.greenend.org.uk> <20020529131927.C64995@kayak.xcllnt.net> <200205292027.g4TKRfnv031668@khavrinen.lcs.mit.edu> <20020529133846.E64995@kayak.xcllnt.net> <20020529233248.A24780@schweikhardt.net> <20020529230137.GA306@dhcp01.pn.xcllnt.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020529230137.GA306@dhcp01.pn.xcllnt.net>; from marcel@xcllnt.net on Wed, May 29, 2002 at 04:01:37PM -0700 Sender: owner-cvs-all@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Wed, May 29, 2002 at 04:01:37PM -0700, Marcel Moolenaar wrote: > > No, I assume that the compiler does do gratuitous padding, beyond > what is reasonable or expected. Especially not to extend the size > of the struct after the last field. C99 section 6.7.2.1 "Structure and union specifiers" paragraph 14: "There may be unnamed padding at the end of a structure or union." I wonder how you expect C to work without this permission, given that pointer arithmetic is defined in terms of the size of the object pointed to, and given hard alighment requirements on some machines. (char *)(p + 1) == (char *)p + sizeof(*p) p + 1 == &p[1] (Despite what phk says C must always have allowed padding at the end of structs. Many implementations, especially on PCs which don't have hard alignment requirements, won't have used the facility.) Tony. -- f.a.n.finch http://dotat.at/ SOUTHEAST ICELAND: CYCLONIC 4 OR 5, OCCASIONALLY 6 IN SOUTH LATER. RAIN AT TIMES. MODERATE OR POOR. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message