Date: Mon, 13 Nov 2000 22:56:55 GMT From: Salvo Bartolotta <bartequi@inwind.it> To: bdluevel@heitec.net, "Crist J . Clark" <cjclark@reflexnet.net>, freebsd-questions@FreeBSD.ORG Subject: Re: OT: curious (??) integer types behavio(u)r... Message-ID: <20001113.22565500@bartequi.ottodomain.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>
index | next in thread | previous in thread | raw e-mail
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<< On 11/13/00, 9:31:19 AM, bdluevel@heitec.net wrote regarding Re: OT: curious (??) integer types behavio(u)r...: <cc complaints about line 15, 17 snipped> > > > int d1 = -2147483648; /* line 15 */ > > > int d2 = 2147483647; > > > unsigned int d = 4294967295; <snip> > The line in question is int d1 = -2147483648; > But here, the number 2147483648 can't be represented by a signed '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 be > applied, resulting in 2147483648U. <snip> > 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 messagehelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001113.22565500>
