delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2014/04/07/10:42:55

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; q=dns; s=
default; b=iGOxm7V4GcTbYSa6pzMZZu+dPGonhLT8gMUvWCFCWoc/3Kd6WNoDI
5iqjUqJlg+FTywa2fCA0e2XqhfEnJuWWCr09HYbjnnt7WjmRqDIeReci2ZsSFkpo
JjgyioGGmnP9OxpOgxr69sbarIrE/hFQTt6ttx4wTiAb7bJ/Bvm+Fg=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:to:subject:message-id:reply-to
:references:mime-version:content-type:in-reply-to; s=default;
bh=5xkKo9aQyn1nkZAXNwGus/KzJxs=; b=TpqCXWcPyTlOgumflOlpfQLgRtOR
Ippnwd0cSGBmOVGAOCorgBkxrDHZEtIZxo5dIq8GaBaK64T9Vj9lQ92ehyVTPXKh
TabwfbYe/0OxKUbEOPduXjMHbu5n1AJKlAwVm0XmoD+SvnNmdmxv34VZULdVxjD2
DHB9VjzhiAxPwww=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-5.9 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.2
X-HELO: calimero.vinschen.de
Date: Mon, 7 Apr 2014 16:42:34 +0200
From: Corinna Vinschen <corinna-cygwin AT cygwin DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: long_int vs int byte sizes
Message-ID: <20140407144234.GO2061@calimero.vinschen.de>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <CABKp57PdLMKqmGFhfMEN4BLPFcndkpibora5yx2Xdy6zh4+WzA AT mail DOT gmail DOT com> <6BA0E670DE2A4416BB5A12250B427E5A AT OwnerPC311012> <20140407084720 DOT GC2061 AT calimero DOT vinschen DOT de> <5342B32D DOT 80508 AT redhat DOT com>
MIME-Version: 1.0
In-Reply-To: <5342B32D.80508@redhat.com>
User-Agent: Mutt/1.5.21 (2010-09-15)

--c8JyeaiReRNoiMDS
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Apr  7 08:16, Eric Blake wrote:
> On 04/07/2014 02:47 AM, Corinna Vinschen wrote:
>=20
> >=20
> > There's no standard which restricts the sizes of the datatypes in
> > that way.  There's only this rule to follow:
> >=20
> >   sizeof (char) <=3D sizeof (short) <=3D sizeof (int) <=3D sizeof (long)
>=20
> Well, there IS the C rule that sizeof(char)=3D=3D1, and also that char ho=
lds
> >=3D 8 bits, short holds >=3D 8 bits, int holds >=3D 16 bits, long holds =
>=3D 32
> bits.  There is also a POSIX rule that CHAR_BITS=3D=3D8 (so while C allow=
s a
> 9-bit or 32-bit char [and yes, such machines exist, although rare],
> POSIX does not allow that).

Apart from POSIX, where is that defined?  The old K&R rules only defined
the sizes of the datatypes in comparison to each other, but it never
defined minimum sizes.  If you have a 7 bit machine and you only use
ASCII, you can be happy ever after.  And while it *suggested* that short
< long, it didn't demand it.

> POSIX does not allow that).  But in general, on most modern porting
> platforms, 'long' is a redundant type - it will either be equal in size
> to 'int' (typical for a 32-bit machine) or to a 'long long' (typical for
> a 64-bit machine); it only mattered on 16-bit machines which are now
> museum pieces.

Xstormy16?


Corinna

--=20
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Maintainer                 cygwin AT cygwin DOT com
Red Hat

--c8JyeaiReRNoiMDS
Content-Type: application/pgp-signature

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBAgAGBQJTQrlaAAoJEPU2Bp2uRE+gAt8QAJB/z2wi268p7p7KO/rVPvWD
Xt4goHiElY8vmW61GBa3mLGCLsR+PMLBW/rKu/ofn2fbJPEs2qacU/T2BBvfcSZW
vWp6+4YLEatnJDzTIhhS48sV2Jiw5dK4vwmfYV0k7DoDJYFUBTFH+QKlRfibHCbP
FLSt+3RctFIGv7FgQv/6oSWQk3HHyLRIc994SB2lUSeyF8+t0Pq3EkKyPsKm5Og0
TGDuYayhjzdsO01EUcZHzgzHrk6DA3p6BiOadFchrTrWpFgmaOgmrKizlPgwn/DX
Vh0MD6YZ0PG73iJtyTidTIvgZHpbPa0dLQvbQGqKk2tsBq4Yefogj5Bw7WaZnhit
/Kw7HM9lgXjdyhHWIaIqmvLR96/xv7d1YgAK+dTByP4EgpfladkqBbyKIN6ZxyYf
daWLxTuPFT3c5wtKUvqJMG5gQQins7cHv0jeaHyrrSXFHQgy8lFCtB4kG7nWEJR6
kU4xb9BaQNLOoqavwsYXT9uFX3p5UEJ9tgMS5chqs3iTPHxznlD4thGHeTSraSWe
NsOPlQDpCv8b7KqEzFzkTMjjgxuIQ9AyOzJWFN2jTqLvZxmpVY5Lp5GXL5/9Bl/m
ghogmvHsW2Dq2zglAa3rgzofA3XmShHILcFwRmkiILR80gQcocjsE2PO8JVSWdes
KZVDoKcZB8wHX7Hows/E
=6jQo
-----END PGP SIGNATURE-----

--c8JyeaiReRNoiMDS--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019