From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16762 invoked by alias); 7 Apr 2014 14:42:39 -0000 Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner@cygwin.com Mail-Followup-To: cygwin@cygwin.com Received: (qmail 16749 invoked by uid 89); 7 Apr 2014 14:42:38 -0000 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 Received: from aquarius.hirmke.de (HELO calimero.vinschen.de) (217.91.18.234) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 07 Apr 2014 14:42:36 +0000 Received: by calimero.vinschen.de (Postfix, from userid 500) id 706548E091E; Mon, 7 Apr 2014 16:42:34 +0200 (CEST) Date: Mon, 07 Apr 2014 14:42:00 -0000 From: Corinna Vinschen To: cygwin@cygwin.com Subject: Re: long_int vs int byte sizes Message-ID: <20140407144234.GO2061@calimero.vinschen.de> Reply-To: cygwin@cygwin.com Mail-Followup-To: cygwin@cygwin.com References: <6BA0E670DE2A4416BB5A12250B427E5A@OwnerPC311012> <20140407084720.GC2061@calimero.vinschen.de> <5342B32D.80508@redhat.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="c8JyeaiReRNoiMDS" Content-Disposition: inline In-Reply-To: <5342B32D.80508@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-SW-Source: 2014-04/txt/msg00119.txt.bz2 --c8JyeaiReRNoiMDS Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-length: 1443 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 Content-length: 819 -----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--