This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


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

Patches: Squelch `U' suffix warnings from md5.h and getext.h


These two patches modify md5.h and gettext.h to use INT_MAX instead of
UINT_MAX to determine the appropriate type to use for an unsigned 32 bit
integer.  This avoids using the `U' suffix.  Tested with a complete 
bootstrap and check.

Dave

--
J. David Anglin                                  dave.anglin@nrc.ca
National Research Council of Canada              (613) 990-0752 (FAX: 952-6605)
--- md5.h.orig	Mon Aug 28 20:29:27 2000
+++ md5.h	Fri Sep  1 19:48:01 2000
@@ -38,28 +38,24 @@
 # include <sys/types.h>
 typedef u_int32_t md5_uint32;
 #else
-# if defined __STDC__ && __STDC__
-#  define UINT_MAX_32_BITS 4294967295U
-# else
-#  define UINT_MAX_32_BITS 0xFFFFFFFF
-# endif
+#  define INT_MAX_32_BITS 2147483647
 
 /* If UINT_MAX isn't defined, assume it's a 32-bit type.
    This should be valid for all systems GNU cares about because
    that doesn't include 16-bit systems, and only modern systems
    (that certainly have <limits.h>) have 64+-bit integral types.  */
 
-# ifndef UINT_MAX
-#  define UINT_MAX UINT_MAX_32_BITS
+# ifndef INT_MAX
+#  define INT_MAX INT_MAX_32_BITS
 # endif
 
-# if UINT_MAX == UINT_MAX_32_BITS
+# if INT_MAX == INT_MAX_32_BITS
    typedef unsigned int md5_uint32;
 # else
-#  if USHRT_MAX == UINT_MAX_32_BITS
+#  if SHRT_MAX == INT_MAX_32_BITS
     typedef unsigned short md5_uint32;
 #  else
-#   if ULONG_MAX == UINT_MAX_32_BITS
+#   if LONG_MAX == INT_MAX_32_BITS
      typedef unsigned long md5_uint32;
 #   else
      /* The following line is intended to evoke an error.
--- intl/gettext.h.orig	Sat Sep  4 11:08:49 1999
+++ intl/gettext.h	Fri Sep  1 19:43:20 2000
@@ -39,30 +39,27 @@
    alternative approach is to use autoconf's AC_CHECK_SIZEOF macro, but
    doing that would require that the configure script compile and *run*
    the resulting executable.  Locally running cross-compiled executables
-   is usually not possible.  */
+   is usually not possible.  We use the maximum values for signed int's
+   for the test to avoid using `U' suffixes.  */
 
-#if __STDC__
-# define UINT_MAX_32_BITS 4294967295U
-#else
-# define UINT_MAX_32_BITS 0xFFFFFFFF
-#endif
+#define INT_MAX_32_BITS 2147483647
 
-/* If UINT_MAX isn't defined, assume it's a 32-bit type.
+/* If INT_MAX isn't defined, assume it's a 32-bit type.
    This should be valid for all systems GNU cares about because
    that doesn't include 16-bit systems, and only modern systems
    (that certainly have <limits.h>) have 64+-bit integral types.  */
 
-#ifndef UINT_MAX
-# define UINT_MAX UINT_MAX_32_BITS
+#ifndef INT_MAX
+# define INT_MAX INT_MAX_32_BITS
 #endif
 
-#if UINT_MAX == UINT_MAX_32_BITS
+#if INT_MAX == INT_MAX_32_BITS
 typedef unsigned nls_uint32;
 #else
-# if USHRT_MAX == UINT_MAX_32_BITS
+# if SHRT_MAX == INT_MAX_32_BITS
 typedef unsigned short nls_uint32;
 # else
-#  if ULONG_MAX == UINT_MAX_32_BITS
+#  if LONG_MAX == INT_MAX_32_BITS
 typedef unsigned long nls_uint32;
 #  else
   /* The following line is intended to throw an error.  Using #error is

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