From owner-freebsd-current@FreeBSD.ORG Fri Oct 31 09:30:11 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8C6D716A4CE for ; Fri, 31 Oct 2003 09:30:11 -0800 (PST) Received: from falcon.midgard.homeip.net (h76n3fls24o1048.bredband.comhem.se [213.67.148.76]) by mx1.FreeBSD.org (Postfix) with SMTP id 5A08843F3F for ; Fri, 31 Oct 2003 09:30:09 -0800 (PST) (envelope-from ertr1013@student.uu.se) Received: (qmail 31990 invoked by uid 1001); 31 Oct 2003 17:30:07 -0000 Date: Fri, 31 Oct 2003 18:30:07 +0100 From: Erik Trulsson To: Garrett Wollman , Bruce Evans , current@freebsd.org Message-ID: <20031031173006.GA21813@falcon.midgard.homeip.net> Mail-Followup-To: Garrett Wollman , Bruce Evans , current@freebsd.org References: <3F9F4FE6.29C4E178@mindspring.com> <3FA0EEFD.431DD759@mindspring.com> <20031030120925.K80335@beagle.fokus.fraunhofer.de> <200310301659.h9UGxAPk023337@khavrinen.lcs.mit.edu> <20031031174658.T3463@gamplex.bde.org> <200310311506.h9VF6h8T030897@khavrinen.lcs.mit.edu> <20031031154337.GA19287@falcon.midgard.homeip.net> <20031031172015.GD866@wombat.fafoe.narf.at> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20031031172015.GD866@wombat.fafoe.narf.at> User-Agent: Mutt/1.5.4i Subject: Re: Anyone object to the following change in libc? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 31 Oct 2003 17:30:11 -0000 On Fri, Oct 31, 2003 at 06:20:17PM +0100, Stefan Farfeleder wrote: > On Fri, Oct 31, 2003 at 04:43:37PM +0100, Erik Trulsson wrote: > > > Perhaps not smaller in terms of the sizeof operator, but why can't one > > have a 16-bit char, and an int8_t which occupies 16 bits, but only uses > > 8 of them - the other 8 being padding? > > 7.18.1.1 Exact-width integer types > > 1 The typedef name intN_t designates a signed integer type with width N, no padding > bits, and a two's complement representation. Thus, int8_t denotes a signed integer > type with a width of exactly 8 bits. I see. My confusion stems from the fact that n869.txt (the last publically available draft of the C99 standard) says 7.18.1.1 Exact-width integer types [#1] The typedef name intN_t designates a signed integer type with width N. Thus, int8_t denotes a signed integer type with a width of exactly 8 bits. The ", no padding bits" part is apparently one of the things that were changed between n869.txt and the final standard. Note to self: I really need to get a copy of the final C99 standard as soon as I can afford one. > > > Where in C99 does it say that uint8_t can't have padding bits? > > I can't find anything in n869.txt to that effect. > > As far as I can tell, the only type that is not allowed to have any > > padding bits or trap representations is unsigned char. > > uint8_t is int8_t's corresponding unsigned type. This means > sizeof(uint8_t) == sizeof(int8_t), thus uint8_t can't have padding bits > either. Yes, with the quote from the standard you supplied above, that becomes clear. -- Erik Trulsson ertr1013@student.uu.se