From owner-cvs-all Wed May 29 10:44:43 2002 Delivered-To: cvs-all@freebsd.org Received: from evilpete.dyndns.org (12-232-26-46.client.attbi.com [12.232.26.46]) by hub.freebsd.org (Postfix) with ESMTP id DD95837C72E; Wed, 29 May 2002 10:42:28 -0700 (PDT) Received: from overcee.wemm.org ([10.0.0.3]) by evilpete.dyndns.org (8.11.6/8.11.6) with ESMTP id g4THgS164868; Wed, 29 May 2002 10:42:28 -0700 (PDT) (envelope-from peter@wemm.org) Received: from wemm.org (localhost [127.0.0.1]) by overcee.wemm.org (Postfix) with ESMTP id 7DD3B3810; Wed, 29 May 2002 10:42:25 -0700 (PDT) (envelope-from peter@wemm.org) X-Mailer: exmh version 2.5 07/13/2001 with nmh-1.0.4 To: Tony Finch Cc: Marcel Moolenaar , Poul-Henning Kamp , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys gpt.h In-Reply-To: <20020529173621.B11817@chiark.greenend.org.uk> Date: Wed, 29 May 2002 10:42:25 -0700 From: Peter Wemm Message-Id: <20020529174225.7DD3B3810@overcee.wemm.org> 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 Tony Finch wrote: > On Tue, May 28, 2002 at 10:36:53PM -0700, Marcel Moolenaar wrote: > > > > I see what you mean, but packing and unpacking is not the problem. It's > > sizeof() that's got it wrong. I don't quite understand why sizeof() > > would yield a size that's 4 bytes longer than the structure actually > > is. It smells like a gcc bug, but I assume for now I'm just missing > > something. > > It's required for correct alignment of the uint64_t members when you > create an array of the struct. ie: struct foo { u_int64_t foo; u_int32_t bar; } sizeof(struct foo) = 16, not 12 like one might expect on i386. Cheers, -Peter -- Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com "All of this is for nothing if we don't go to the stars" - JMS/B5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message