mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rob Landley <rob@landley.net>
To: musl@lists.openwall.com
Cc: musl@lists.openwall.com
Subject: Re: Make bits/wchar.h correct for all architectures (bug 15036) (fwd)
Date: Fri, 25 Jan 2013 07:29:40 -0600	[thread overview]
Message-ID: <1359120580.32505.50@driftwood> (raw)
In-Reply-To: <20130120043721.GM20323@brightrain.aerifal.cx> (from dalias@aerifal.cx on Sat Jan 19 22:37:21 2013)

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 <strake888@gmail.com> wrote:
> >
> > >
> > > On 18/01/2013, Rich Felker <dalias@aerifal.cx> wrote:
> > > > I think the same issues apply to musl, and the solution seems  
> 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  
> 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.
> 
> 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,  
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  
char is 8 bits, short is 16 bits, int is 32 bits. (And that long long  
is at least 64 bits, but never says long long can't be LARGER than 64  
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  
doesn't.

Rob

      reply	other threads:[~2013-01-25 13:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-19  1:11 Rich Felker
2013-01-19 13:58 ` Strake
2013-01-19 19:25   ` Isaac Dunham
2013-01-20  4:37     ` Rich Felker
2013-01-25 13:29       ` Rob Landley [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1359120580.32505.50@driftwood \
    --to=rob@landley.net \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).