From owner-cvs-all Wed May 29 18:50:36 2002 Delivered-To: cvs-all@freebsd.org Received: from kayak.xcllnt.net (209-128-86-226.bayarea.net [209.128.86.226]) by hub.freebsd.org (Postfix) with ESMTP id F186D37B403; Wed, 29 May 2002 18:50:16 -0700 (PDT) Received: from dhcp01.pn.xcllnt.net (dhcp01.pn.xcllnt.net [192.168.4.201]) by kayak.xcllnt.net (8.11.6/8.11.4) with ESMTP id g4U1o6J66088; Wed, 29 May 2002 18:50:06 -0700 (PDT) (envelope-from marcel@kayak.pn.xcllnt.net) Received: from dhcp01.pn.xcllnt.net (localhost [127.0.0.1]) by dhcp01.pn.xcllnt.net (8.12.3/8.12.3) with ESMTP id g4U1o7bJ000715; Wed, 29 May 2002 18:50:07 -0700 (PDT) (envelope-from marcel@dhcp01.pn.xcllnt.net) Received: (from marcel@localhost) by dhcp01.pn.xcllnt.net (8.12.3/8.12.3/Submit) id g4U1o7Bu000714; Wed, 29 May 2002 18:50:07 -0700 (PDT) (envelope-from marcel) Date: Wed, 29 May 2002 18:50:07 -0700 From: Marcel Moolenaar To: Peter Wemm Cc: Jens Schweikhardt , Garrett Wollman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys gpt.h Message-ID: <20020530015007.GA393@dhcp01.pn.xcllnt.net> References: <20020529230137.GA306@dhcp01.pn.xcllnt.net> <20020529234420.3FE6B380A@overcee.wemm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20020529234420.3FE6B380A@overcee.wemm.org> User-Agent: Mutt/1.3.99i 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:44:20PM -0700, Peter Wemm wrote: > Marcel Moolenaar wrote: > > On Wed, May 29, 2002 at 11:32:48PM +0200, Jens Schweikhardt wrote: > > > > > > It is. The answer is sizeof (struct X). You are the one to make > > > nonportable assumptions by thinking there must be no padding. > > > > 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. > > This has got me before. The usual behavior is that the stuct is rounded up > to be an even multiple of the most restrictive alignment requirement of > members. This is so that sizeof(struct foo[20]) == sizeof(struct foo) * 20. Strangely enough, I find it more natural when the equality doesn't hold in case the struct size if not a multiple of the alignment. What really kicks me in the nuts is that I have never seen or experienced this behaviour before. Sure, padding between fields, naturally, but extending the size of a structure.. no. That's why I'm so totally amazed. We're talking POLA violation here for me; with big V... :-( As such, I'll be digesting this for the next couple of days. I have a very strong tendency to reject this behaviour as the most stupid thing since... since... wow, I think it really stands alone in its infinite stupidity :-) Clearly not the right mindset to be hacking... -- Marcel Moolenaar USPA: A-39004 marcel@xcllnt.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message