Skip site navigation (1)Skip section navigation (2)
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>

next in thread | previous in thread | raw e-mail | index | archive | help
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<

On 11/13/00, 9:31:19 AM, bdluevel@heitec.net wrote regarding Re: OT:=20
curious (??) integer types behavio(u)r...:

<cc complaints about line 15, 17 snipped>

> > >            int d1 =3D -2147483648;  /* line 15 */     =20
> > >            int d2 =3D 2147483647;
> > >            unsigned int d =3D 4294967295;

<snip>

> 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.

<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 message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20001113.22565500>