[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: stdint and cygwin bug
From: |
Eric Blake |
Subject: |
Re: stdint and cygwin bug |
Date: |
Thu, 05 Apr 2007 13:37:49 -0600 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.10) Gecko/20070221 Thunderbird/1.5.0.10 Mnenhy/0.7.5.666 |
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
According to Paul Eggert on 4/5/2007 10:07 AM:
>> - int check_WINT: WINT_MIN <= 0 && 0 < WINT_MAX ? 1 : -1;
>> + int check_WINT: WINT_MIN <= (wint_t) 0 && (wint_t) 0 < WINT_MAX ? 1 : -1;
>
> This fix looks suspicious to me, as I think it might cause the test to
> improperly succeed where it used to fail, on hosts with bugs other
> than Cygwin.
>
> What exactly is the Cygwin bug? Why does this change detect it?
On cygwin, wint_t is unsigned, but WINT_MIN was INT_MIN. Comparing
WINT_MIN to a signed 0 succeeded (using signed comparison), but comparing
it to (wint_t)0 correctly detected that WINT_MIN was not 0 (because it
forced an unsigned compare). It shows two bugs - first, that WINT_MIN was
not 0; and second, that WINT_MIN was a signed value even though wint_t is not.
- --
Don't work too hard, make some time for fun as well!
Eric Blake address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFGFVAN84KuGfSFAYARAsXQAJ48YulAQj3WGc4fwM4I+iHwq0m82ACgmECo
NfcRYW105j8+CD+GQ2MraPQ=
=nzXc
-----END PGP SIGNATURE-----
- stdint and cygwin bug, Eric Blake, 2007/04/03
- Re: stdint and cygwin bug, Paul Eggert, 2007/04/03
- Re: stdint and cygwin bug, Eric Blake, 2007/04/04
- Re: stdint and cygwin bug, Bruno Haible, 2007/04/04
- Re: stdint and cygwin bug, Eric Blake, 2007/04/04
- Re: stdint and cygwin bug, Paul Eggert, 2007/04/05
- Re: stdint and cygwin bug,
Eric Blake <=
- Re: stdint and cygwin bug, Paul Eggert, 2007/04/05
- Re: stdint and cygwin bug, Bruno Haible, 2007/04/05