From owner-freebsd-arch@FreeBSD.ORG Wed Jun 20 10:52:43 2012 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id F41221065674 for ; Wed, 20 Jun 2012 10:52:42 +0000 (UTC) (envelope-from andrew@fubar.geek.nz) Received: from smtp4.clear.net.nz (smtp4.clear.net.nz [203.97.37.64]) by mx1.freebsd.org (Postfix) with ESMTP id BBDCE8FC18 for ; Wed, 20 Jun 2012 10:52:42 +0000 (UTC) Received: from mxin1-orange.clear.net.nz (lb2-srcnat.clear.net.nz [203.97.32.237]) by smtp4.clear.net.nz (CLEAR Net Mail) with ESMTP id <0M5W0082BWVN3M10@smtp4.clear.net.nz> for arch@freebsd.org; Wed, 20 Jun 2012 22:52:35 +1200 (NZST) Received: from 202-0-48-19.paradise.net.nz (HELO localhost) ([202.0.48.19]) by smtpin1.paradise.net.nz with ESMTP; Wed, 20 Jun 2012 22:52:35 +1200 Date: Wed, 20 Jun 2012 22:52:00 +1200 From: Andrew Turner In-reply-to: <20120620011811.X2306@besplex.bde.org> To: Bruce Evans Message-id: <20120620225200.7566b177@fubar.geek.nz> MIME-version: 1.0 X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; i386-portbld-freebsd8.0) Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7bit X-Pirate: Arrrr References: <20120617171125.18836c93@fubar.geek.nz> <20120619234520.76121ece@fubar.geek.nz> <20120620011811.X2306@besplex.bde.org> Cc: arch@FreeBSD.org Subject: Re: wchar_t change for ARM EABI X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Jun 2012 10:52:43 -0000 I have updated the patch at [1]. [1] http://people.freebsd.org/~andrew/wchar_unsigned_2.diff On Wed, 20 Jun 2012 01:47:34 +1000 (EST) Bruce Evans wrote: > On Tue, 19 Jun 2012, Andrew Turner wrote: > > I have an updated patch at [1]. This moves __WCHAR_MIN/__WCHAR_MAX > > from to as they are limits > > rather than types. Does anybody see any issues with this? If not > > I'll update it for all architectures and commit later in the week. > > I hoped to keep the types and limits closer together, especially for > the types that are declared in . > has mainly limits for basic (non-typedefed) > types. The exceptions were just for size_t, ssize_t, off_t, and > *quad_t (ugh). I've moved them back to . > This still says that wchar_t MUST be the same as rune_t... > > % typedef int __ct_rune_t; /* arg type > for ctype funcs */ % typedef __ct_rune_t > __rune_t; /* rune_t (see above) */ % -typedef > __ct_rune_t __wchar_t; /* wchar_t (see above) */ > > ... but rune_t is still int, while wchar_t can be different (it is > unsigned on arm_eabi). As far as I can tell the comment was incorrect. rune_t must be the same type as wint_t, it just happens that wchar_t was also the same type. > % typedef __ct_rune_t __wint_t; /* wint_t (see > above) */ > > The above removes a MUST on wint_t instead, but wint_t hasn't been > changed. Was that intended? The MUST is still satisfied, but isn't > stated quite right, since the sign bit is normally counted as part of > the width but probably shouldn't be in this requirement. I removed the MUST as, on ARM EABI, the number of usable bits for a character in a wint_t is now less than the number of bits in a wchar_t. > % > % typedef __uint32_t __dev_t; /* device number > */ % ... > % Index: sys/arm/include/_limits.h > % =================================================================== > % --- sys/arm/include/_limits.h (revision 237150) > % +++ sys/arm/include/_limits.h (working copy) > % @@ -78,6 +78,14 @@ > % #define __QUAD_MAX __LLONG_MAX /* max value > for a quad_t */ % #define __QUAD_MIN > __LLONG_MIN /* min value for a quad_t */ % > % +#ifdef __ARM_EABI__ > % +#define __WCHAR_MIN (0) > > Bogus parentheses. Ok. > % +#define __WCHAR_MAX __UINT_MAX > % +#else > % +#define __WCHAR_MIN __INT_MIN > % +#define __WCHAR_MAX __INT_MAX > % +#endif > % + > > These definitions are missing banal comments, unlike all the other > definitions except the ones for __LONG_BIT and __WORD_BIT. (The one > for __MINSIGSTKSZ is not missing, but is in an inconsistent style.) Ok. Andrew