bug-gnulib
[Top][All Lists]
Advanced

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

[bug-gnulib] Re: warnings in human.c about UINTMAX_MAX redefine


From: Paul Eggert
Subject: [bug-gnulib] Re: warnings in human.c about UINTMAX_MAX redefine
Date: Tue, 04 Jan 2005 10:55:21 -0800
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

address@hidden (Bob Proulx) wrote:

> cc -DHAVE_CONFIG_H -DLIBDIR=\"/usr/local/lib\" -I. -I. -I..  -I.. -I.   -Ae 
> -c human.c
> cpp: "/usr/include/inttypes.h", line 135: warning 2001: Redefinition of macro 
> UINTMAX_MAX.

I fixed this in the obvious way, then searched for other people with
the same problem.  Google says Nelson H. F. Beebe reported the same
problem for GNU findutils
<http://lists.gnu.org/archive/html/bug-findutils/2004-12/msg00079.html>
and James Youngman came up with a patch that was identical to mine
(save comments).  The patch seems quite harmless and straightforward
so I have installed it in both coreutils and gnulib:

2005-01-04  Paul Eggert  <address@hidden>

        * human.c (SIZE_MAX, UINTMAX_MAX): Move these conditional
        definitions to be after all include files, to avoid collisions.
        Problem reported by Bob Proulx.

--- human.c.~1.29.~     2004-12-01 15:21:33 -0800
+++ human.c     2005-01-04 10:41:32 -0800
@@ -25,13 +25,6 @@
 
 #include "human.h"
 
-#ifndef SIZE_MAX
-# define SIZE_MAX ((size_t) -1)
-#endif
-#ifndef UINTMAX_MAX
-# define UINTMAX_MAX ((uintmax_t) -1)
-#endif
-
 #include <locale.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -44,6 +37,13 @@
 #include <error.h>
 #include <xstrtol.h>
 
+#ifndef SIZE_MAX
+# define SIZE_MAX ((size_t) -1)
+#endif
+#ifndef UINTMAX_MAX
+# define UINTMAX_MAX ((uintmax_t) -1)
+#endif
+
 /* The maximum length of a suffix like "KiB".  */
 #define HUMAN_READABLE_SUFFIX_LENGTH_MAX 3
 




reply via email to

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