From owner-cvs-all Wed May 29 16:51:23 2002 Delivered-To: cvs-all@freebsd.org Received: from beppo.feral.com (beppo.feral.com [192.67.166.79]) by hub.freebsd.org (Postfix) with ESMTP id A2F5E37B407; Wed, 29 May 2002 16:51:15 -0700 (PDT) Received: from mailhost.feral.com (mjacob@mailhost.feral.com [192.67.166.1]) by beppo.feral.com (8.11.3/8.11.3) with ESMTP id g4TNovg23925; Wed, 29 May 2002 16:50:57 -0700 (PDT) (envelope-from mjacob@feral.com) Date: Wed, 29 May 2002 16:50:56 -0700 (PDT) From: Matthew Jacob X-Sender: mjacob@beppo Reply-To: mjacob@feral.com To: Peter Wemm Cc: Marcel Moolenaar , Jens Schweikhardt , Garrett Wollman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys gpt.h In-Reply-To: <20020529234420.3FE6B380A@overcee.wemm.org> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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, 29 May 2002, 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. > > I have a vague recollection that I saw a compiler a long time ago (early > Lattice C on the Amiga possibly?) where this wasn't the case. Many compilers. Borland C or any of the i386 compilers that assumed you wanted pragma packed IIRC. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message