From owner-cvs-all Wed May 29 14:49:53 2002 Delivered-To: cvs-all@freebsd.org Received: from bremen.shuttle.de (bremen.shuttle.de [194.95.249.251]) by hub.freebsd.org (Postfix) with ESMTP id 7A8CC37B404; Wed, 29 May 2002 14:49:35 -0700 (PDT) Received: from bremen.shuttle.de (localhost [127.0.0.1]) by bremen.shuttle.de (Postfix) with ESMTP id 8ED1A17DCF; Wed, 29 May 2002 23:49:31 +0200 (CEST) Received: (from uucp@localhost) by bremen.shuttle.de (8.12.3/8.12.3/Debian -4) with UUCP id g4TLnVUg004309; Wed, 29 May 2002 23:49:31 +0200 Received: from hal9000.schweikhardt.net (localhost [127.0.0.1]) by hal9000.schweikhardt.net (8.12.3/8.12.3) with ESMTP id g4TLWo14024925; Wed, 29 May 2002 23:32:50 +0200 (CEST) (envelope-from schweikh@hal9000.schweikhardt.net) Received: (from schweikh@localhost) by hal9000.schweikhardt.net (8.12.3/8.12.3/Submit) id g4TLWmOf024924; Wed, 29 May 2002 23:32:48 +0200 (CEST) Date: Wed, 29 May 2002 23:32:48 +0200 From: Jens Schweikhardt To: Marcel Moolenaar Cc: Garrett Wollman , cvs-committers@FreeBSD.org, cvs-all@FreeBSD.org Subject: Re: cvs commit: src/sys/sys gpt.h Message-ID: <20020529233248.A24780@schweikhardt.net> 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> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020529133846.E64995@kayak.xcllnt.net>; from marcel@xcllnt.net on Wed, May 29, 2002 at 01:38:46PM -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 01:38:46PM -0700, Marcel Moolenaar wrote: # On Wed, May 29, 2002 at 04:27:41PM -0400, Garrett Wollman wrote: # > < said: # > # > > what's the size of struct X { int64_t a; int32_t b; }; # > # > > There's no value in an answer that starts of with "It depends...". # > > The size should always be 12 bytes, independent of any alignment # > > requirements I may attach to it. # > # > The C programming language does not work that way, and has never # > worked that way. # # I thought it was designed to be portable. It is. The answer is sizeof (struct X). You are the one to make nonportable assumptions by thinking there must be no padding. # It looks to me that not # being able to depend on such fundamental properties annihilate # the goal of portability. Even a char does not have to be 8 bits # anymore then... Which makes C portable to systems where CHAR_BIT is 32, like many of today's DSPs. # I mean: sizeof(char x[20]) may then very well yield 21... A portable C program wouldn't stop working if it was so. # Ah, well... No point getting all "Don Quixote" about this... Yes, there's a reason why C is the way it is :-) Regards, Jens -- Jens Schweikhardt http://www.schweikhardt.net/ SIGSIG -- signature too long (core dumped) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe cvs-all" in the body of the message