From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/2679 Path: news.gmane.org!not-for-mail From: Rob Landley Newsgroups: gmane.linux.lib.musl.general Subject: Re: Make bits/wchar.h correct for all architectures (bug 15036) (fwd) Date: Fri, 25 Jan 2013 07:29:40 -0600 Message-ID: <1359120580.32505.50@driftwood> References: <20130119011133.GL20323@brightrain.aerifal.cx> <20130119112559.626f5e11.idunham@lavabit.com> <20130120043721.GM20323@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; DelSp=Yes; Format=Flowed Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1359219075 19367 80.91.229.3 (26 Jan 2013 16:51:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 26 Jan 2013 16:51:15 +0000 (UTC) Cc: musl@lists.openwall.com To: musl@lists.openwall.com Original-X-From: musl-return-2680-gllmg-musl=m.gmane.org@lists.openwall.com Sat Jan 26 17:51:35 2013 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1Tz8yd-0001Jv-7B for gllmg-musl@plane.gmane.org; Sat, 26 Jan 2013 17:51:35 +0100 Original-Received: (qmail 31857 invoked by uid 550); 26 Jan 2013 16:51:16 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 31849 invoked from network); 26 Jan 2013 16:51:15 -0000 X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:date:from:subject:to:cc:references:in-reply-to:x-mailer :message-id:mime-version:content-type:content-disposition :content-transfer-encoding:x-gm-message-state; bh=mwK+GJUvp5RpUUuOW1ebYvBLxZhOmS4hWwmMUjAg8Jg=; b=TeLjWDNnVh/cXk7YVOkdYEbn7w4Te2bLzeYW3D1ZZuxC37WBEHsxnEKYnGRpMPbUkH PF4ukHF3WxfnKUG3ET3kYuYP3Itogpca+3vWg7HTczBwZQqOvtlP2kTpoolShgBQ8wC0 rdJzjDvK+9kMql8V4YoGXHCXcSIKuoyTz9u2CpzV3UpfThFiCdbewh1nypCIgiKOczz2 9P/JVIaCkueJx5TiQSdH7r/WAbsTFKBx5ifoH4FaJbGfVhPTiSot9skRymRBex/SQo+z Pmoyapq8im3pK1u4vNJF7FmE81Ibtjag1ARODp9FJI9me2y2TfIcezqSrjntvy3Ytt19 TMAQ== X-Received: by 10.50.151.238 with SMTP id ut14mr1369039igb.72.1359219063318; Sat, 26 Jan 2013 08:51:03 -0800 (PST) In-Reply-To: <20130120043721.GM20323@brightrain.aerifal.cx> (from dalias@aerifal.cx on Sat Jan 19 22:37:21 2013) X-Mailer: Balsa 2.4.11 Content-Disposition: inline X-Gm-Message-State: ALoCoQmfOUNlGjJp66Y4AgNF7nG6T2rKjc62g6V0w8aPFukpr7gudZdz5fkPvxPCLjvE98xCVxEY Xref: news.gmane.org gmane.linux.lib.musl.general:2679 Archived-At: On 01/19/2013 10:37:21 PM, Rich Felker wrote: > On Sat, Jan 19, 2013 at 11:25:59AM -0800, Isaac Dunham wrote: > > On Sat, 19 Jan 2013 08:58:40 -0500 > > Strake wrote: > > > > > > > > On 18/01/2013, Rich Felker wrote: > > > > I think the same issues apply to musl, and the solution seems =20 > very > > > > elegant. Maybe we can apply the same thing. What do you think? > > > > > > What if int is not 32-bit? > > > > Not possible on a (current) POSIX system, to the best of my =20 > knowledge. > > Also not compatible with any glibc or LSB abi, or any Linux port. > > > > In other words: Unless you're planning to port musl to ELKS or > > Win16/Win64, you're joking. And I would venture to say that you > > would be joking in those cases, too. >=20 > I think Strake's concern was not about 16-bit int (which POSIX > precludes) but rather the possibility of 64-bit int or such. For > better or worse, there are many practical reasons int should never be > larger than 32-bit, the most serious of which are connected to the > side effects of integer promotion rules. And in any case, all relevant > systems (keep in mind this is musl, not an application, so it can > assume its own implementation details) have 32-bit int and always > will. There is an actual standard on this, it's called LP64 from unix.org, =20 and Linux (and MacOS X, and the BSDs) explicitly support it: The LP64 standard: http://www.unix.org/whitepapers/64bit.html Rationale document: http://www.unix.org/version2/whatsnew/lp64_wp.html LP64 says that "long is the same size as pointer". It also says that =20 char is 8 bits, short is 16 bits, int is 32 bits. (And that long long =20 is at least 64 bits, but never says long long can't be LARGER than 64 =20 bits, although nothing is so far that I've found.) Windows does not support LP64, for insane legacy reasons described here: http://blogs.msdn.com/oldnewthing/archive/2005/01/31/363790.aspx But I believe they're pretty much the only one still shipping that =20 doesn't. Rob=