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=V1VlX/J10sPC3xoJ0ghhx0nhRy/WV6IUdqGJzcM+NIlnD0QLOTWKA hU/sZsnVyerB+VP6tcqHbGioQuLI8JbZIXlHlMbnImAvtcYO/R+AMTwb75Rc3GXN Cs1pPs7qF7wka2gDZVuHlwgIOrsag6VozbZusDWY2nEnp9q4egGJ98= 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=YuIQ9+8H6Mse3LpJg2viZhngq84=; b=lQTG0iDewlsAwpb8134RtsIQQR7S IPdb3Ry+bxXzAlWFrRlOvYBTUgg/OqO0MypV0CW8Pph4gsgiA4Fi/9fG0xPtFnZ9 mjwR7iFi7Iad6GdIlywDEolJNW9DGgj2yqZv8cd/LOsFWbzwTBKJALtAQGgrvsmJ pdlOn6R7Ce1RwNc= Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , 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 17:51:31 +0200 From: Corinna Vinschen To: cygwin AT cygwin DOT com Subject: Re: long_int vs int byte sizes Message-ID: <20140407155131.GR2061@calimero.vinschen.de> Reply-To: cygwin AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com References: <6BA0E670DE2A4416BB5A12250B427E5A AT OwnerPC311012> <20140407084720 DOT GC2061 AT calimero DOT vinschen DOT de> <5342B32D DOT 80508 AT redhat DOT com> <20140407144234 DOT GO2061 AT calimero DOT vinschen DOT de> <5342C6B1 DOT 2030106 AT redhat DOT com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="rZHzn+A9B7nBTGyj" Content-Disposition: inline In-Reply-To: <5342C6B1.2030106@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) --rZHzn+A9B7nBTGyj Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Apr 7 09:39, Eric Blake wrote: > On 04/07/2014 08:42 AM, Corinna Vinschen wrote: > > On Apr 7 08:16, Eric Blake wrote: > >> On 04/07/2014 02:47 AM, Corinna Vinschen wrote: > >> > >>> > >>> There's no standard which restricts the sizes of the datatypes in > >>> that way. There's only this rule to follow: > >>> > >>> sizeof (char) <=3D sizeof (short) <=3D sizeof (int) <=3D sizeof (lo= ng) > >> > >> Well, there IS the C rule that sizeof(char)=3D=3D1, and also that char= holds > >>> =3D 8 bits, short holds >=3D 8 bits, int holds >=3D 16 bits, long hol= ds >=3D 32 > >> bits. There is also a POSIX rule that CHAR_BITS=3D=3D8 (so while C al= lows a > >> 9-bit or 32-bit char [and yes, such machines exist, although rare], > >> POSIX does not allow that). > >=20 > > Apart from POSIX, where is that defined? >=20 > C99 5.2.4.2.1 Sizes of integer types >=20 > requires CHAR_BIT to be 8 or larger, UCHAR_MAX to be 255 or larger, > USHRT_MAX to be 65535 or larger (oh, so I was wrong above; 8-bit short > is not allowed), UINT_MAX to be 65535 or larger, ULONG_MAX to be > 4294967295 or larger, and ULLONG_MAX to be 18446744073709551615 or larger. C99 actually requires that? Wow. Modern times... > > Xstormy16? >=20 > Okay, so maybe 16-bit machines aren't all museum pieces - but they also > aren't portability targets for the majority of programs run on cygwin :) Probably not, but I don't know a Cygwin application to control a washing machine either :) Corinna --=20 Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Maintainer cygwin AT cygwin DOT com Red Hat --rZHzn+A9B7nBTGyj Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJTQsmDAAoJEPU2Bp2uRE+gDo4P/3PWhB84HLCczLRDZfVnlzpL ZDhbu/RYt7tp9e1WvifvewWKfHRUJcQrKcVx7YekQVgKZZmeEwfyHgCerS7miPtx sh9TJOvYYqLFTEehh5HdFMJVCX2O2LfZXMwTQIF7miNQtqe5igj8sHd11CDKOesy vpGySklxSuu8bHu0HoDGjdV9a7olxA17msKESC6DfBSs0OnrZVIBQiRfbCq169Bf Ft1MU8xpsbuH7/g/Hclwv1FBSUvJOrtjSJgWBzXBgoVzuClATHbOHYZKw45oTHNz X1Pif0Z7PRjU1KeygyClVL05us+OVeltPqRKxcU/Q9Gn0e7ujw+ZlrnvBOg4kJxW 4CgmYSQnXs9HGWM58MZ92pujJ2YvSCnv8F/s2us+G+duz41pZM6IAtjbkFO0HEa0 MrPDzqtohYFm1qOI4QbE4JFrMjAtirNais76Gt4m1m50HA0+2cMxUKmdXQFnaB+H g+uS3hmLk6M+WNpMRX/Pp2w36KtSzv+7irwaLh5bHlaWFjSyYqEWZODuhGEZvsF0 Y1qqR6loHvfktCDshCsN5TiiNH+Yfm/dPEEGi3u8H7dpuyLbKKWfduBfpDRrbexf IVnXWN4hJCi6JcM+cjbQVLDAOVec4YjT9t35s84oM9/1+GBfjSmBODHvIAVElTrH MHJbF9XtHmgu/ZNpH1Np =BmiF -----END PGP SIGNATURE----- --rZHzn+A9B7nBTGyj--