This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: stdint.h bug


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

According to Christopher Faylor on 4/3/2007 1:13 PM:
> On Tue, Apr 03, 2007 at 06:15:14PM +0000, Eric Blake wrote:
>> Cygwin defines wint_t as unsigned int (valid, per POSIX), but then defines
>>
>> #ifndef WINT_MIN
>> #define WINT_MIN (-2147483647 - 1)
>> #define WINT_MAX (2147483647)
>> #endif
>>
>> which is invalid given the underlying type of wint_t.  Can we get this fixed 
>> (either make wint_t a signed type, or change WINT_MIN and WINT_MAX)?
> 
> Patch?

Well, I was hoping for some feedback as to whether changing wint_t to be
signed was preferable over changing WINT_MIN.  But further research shows
Linux also uses an unsigned type for wint_t, so:

2007-04-03  Eric Blake  <ebb9@byu.net>

	* include/stdint.h (WINT_MIN, WINT_MAX): Fix definition.

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

Eric Blake             ebb9@byu.net
-----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

iD8DBQFGEv9/84KuGfSFAYARAo1OAJ9Ig6W0WqaMfGWN4njXieB8AJb0pwCgh3FE
x5B6wtRLeWqvadttHSbl6Hw=
=fB6i
-----END PGP SIGNATURE-----
Index: include/stdint.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/stdint.h,v
retrieving revision 1.7
diff -u -p -r1.7 stdint.h
--- include/stdint.h	3 Jul 2006 12:30:04 -0000	1.7
+++ include/stdint.h	4 Apr 2007 01:27:08 -0000
@@ -1,6 +1,6 @@
 /* stdint.h - integer types
 
-   Copyright 2003, 2006 Red Hat, Inc.
+   Copyright 2003, 2006, 2007 Red Hat, Inc.
 
 This file is part of Cygwin.
 
@@ -158,8 +158,8 @@ typedef unsigned long long uintmax_t;
 #endif
 
 #ifndef WINT_MIN
-#define WINT_MIN (-2147483647 - 1)
-#define WINT_MAX (2147483647)
+#define WINT_MIN 0
+#define WINT_MAX UINT_MAX
 #endif
 
 /* Macros for minimum-width integer constant expressions */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]