This is the mail archive of the
cygwin-patches
mailing list for the Cygwin project.
Re: [PATCH] Fix type inconsistencies in stdint.h
Corinna Vinschen wrote:
> Good point, I guess. So, if we all agree on that, I'd suggest to
> change Dave's patch to the one below.
Two hunks went astray in the adjustment, the fixes for INTPTR_Mxx and
SIZE_MAX still apply because we didn't change their types.
Also, Joseph just introduced a new testcase in GCC SVN, and it shows up a
problem with our definition of WINT_MAX. With the attached patch, and the one
I'm about to submit to gcc to update the types we just changed, everything
matches up and is correct and all the gcc.dg/c99-stdint-*.c tests pass.
Ok?
winsup/cygwin/ChangeLog
* include/stdint.h (INTPTR_MIN, INTPTR_MAX): Add 'L' suffix.
(WINT_MAX): Add 'U' suffix.
cheers,
DaveK
Index: winsup/cygwin/include/stdint.h
===================================================================
RCS file: /cvs/src/src/winsup/cygwin/include/stdint.h,v
retrieving revision 1.11
diff -p -u -r1.11 stdint.h
--- winsup/cygwin/include/stdint.h 7 Apr 2009 17:23:20 -0000 1.11
+++ winsup/cygwin/include/stdint.h 11 Apr 2009 03:37:11 -0000
@@ -119,8 +119,8 @@ typedef unsigned long long uintmax_t;
/* Limits of integer types capable of holding object pointers */
-#define INTPTR_MIN (-2147483647 - 1)
-#define INTPTR_MAX (2147483647)
+#define INTPTR_MIN (-2147483647L - 1L)
+#define INTPTR_MAX (2147483647L)
#define UINTPTR_MAX (4294967295UL)
/* Limits of greatest-width integer types */
@@ -144,7 +144,7 @@ typedef unsigned long long uintmax_t;
#endif
#ifndef SIZE_MAX
-#define SIZE_MAX (4294967295UL)
+#define SIZE_MAX (4294967295U)
#endif
#ifndef WCHAR_MIN
@@ -159,7 +159,7 @@ typedef unsigned long long uintmax_t;
#ifndef WINT_MIN
#define WINT_MIN 0U
-#define WINT_MAX UINT_MAX
+#define WINT_MAX (4294967295U)
#endif
/* Macros for minimum-width integer constant expressions */