From owner-freebsd-questions Mon Nov 13 14:56:20 2000 Delivered-To: freebsd-questions@freebsd.org Received: from relay2.inwind.it (relay2.inwind.it [212.141.53.73]) by hub.freebsd.org (Postfix) with ESMTP id 4F02337B479 for ; Mon, 13 Nov 2000 14:56:17 -0800 (PST) Received: from bartequi.ottodomain.org (62.98.153.45) by relay2.inwind.it (5.1.046) id 3A01ADFF0037A1A1; Mon, 13 Nov 2000 23:56:12 +0100 From: Salvo Bartolotta Date: Mon, 13 Nov 2000 22:56:55 GMT Message-ID: <20001113.22565500@bartequi.ottodomain.org> Subject: Re: OT: curious (??) integer types behavio(u)r... To: bdluevel@heitec.net, "Crist J . Clark" , freebsd-questions@FreeBSD.ORG In-Reply-To: <3A0FA6D7.38C88CF7@heitec.net> References: <20001112.21033200@bartequi.ottodomain.org> <20001112143032.Q75251@149.211.6.64.reflexcom.com> <3A0FA6D7.38C88CF7@heitec.net> X-Mailer: SuperCalifragilis X-Priority: 3 (Normal) MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 11/13/00, 9:31:19 AM, bdluevel@heitec.net wrote regarding Re: OT:=20 curious (??) integer types behavio(u)r...: > > > int d1 =3D -2147483648; /* line 15 */ =20 > > > int d2 =3D 2147483647; > > > unsigned int d =3D 4294967295; > The line in question is int d1 =3D -2147483648; > But here, the number 2147483648 can't be represented by a signed=20 'int'; > however, there is no L or U suffix so the programmer may well intend > such an 'int'. GCC correctly warns that an automatic conversion will=20 be > applied, resulting in 2147483648U. > For extra fun, see the #define of INT_MIN in > /usr/include/machine/limits.h and the explaining comment above it. Thanks to both of you. BTW, adding a "u" suffix to the variables d1 and d made [g]cc happy. Best regards, Salvo To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message