m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] src/freeze.c (GET_NUMBER): Fix a typo.


From: Eric Blake
Subject: Re: [PATCH] src/freeze.c (GET_NUMBER): Fix a typo.
Date: Sun, 11 May 2008 08:05:56 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.14) Gecko/20080421 Thunderbird/2.0.0.14 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

According to Jim Meyering on 5/11/2008 7:00 AM:
| Thanks for humoring me ;-)
| Maybe the test suite never exercises this case?

Actually, the master branch DOES exercise it.  And it passed without your
patch, because...

|       }                                                       \
| -      if (((AllowNeg) ? INT_MIN: INT_MAX) < n                     \
| +      if (((AllowNeg) ? -INT_MIN : INT_MAX) < n                   \

...n is unsigned.  -INT_MIN == INT_MIN on 2's complement machines (and ==
INT_MAX on 1's complement machines, if I remember correctly).  But whether
the int on the left is INT_MIN or INT_MAX, upon conversion to unsigned for
comparison with n on the right, it should result in the correct unsigned
version of INT_MAX or (unsigned)INT_MAX + 1, depending on whether the
machine is 2's complement.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkgm/UQACgkQ84KuGfSFAYAoIQCfeUnNjupIMDxTeyhQ/h5wcDs+
SIgAn2+SHYz6O1TRw/9hv832BFADTfsH
=+1bz
-----END PGP SIGNATURE-----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]