bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: tar 1.13.22 and AIX 4.3.2


From: Paul Eggert
Subject: Re: tar 1.13.22 and AIX 4.3.2
Date: Thu, 6 Sep 2001 12:55:17 -0700 (PDT)

> From: Albert Chin-A-Young <address@hidden>
> User-Agent: Mutt/1.2.5i
> Date: Thu, 6 Sep 2001 14:06:19 -0500
> 
> With the IBM C compiler xlc:
> 
> gmake[2]: Entering directory `/opt/build/tar-1.13.22/lib'
> xlc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl    -O2 -qmaxmem=-1
> -qarch=com -c `test -f strtoumax.c || echo './'`strtoumax.c
> "strtoimax.c", line 87.43: 1506-045 (S) Undeclared identifier ptr.
> 
> This looks just fine to me. Maybe a bug in the IBM C compiler?

Most likely.  Perhaps it is parsing `sizeof function (args)' incorrectly.
But rather than try to debug this, how about trying the following
patch to sidestep the issue?  It also fixes a minor gotcha with signed
versus unsigned configuration.

2001-09-06  Paul Eggert  <address@hidden>

        * lib/strtoimax.c (HAVE_LONG_LONG):
        Redefine to HAVE_UNSIGNED_LONG_LONG if unsigned.
        (strtoimax): Use sizeof (long), not sizeof strtol (ptr,
        endptr, base), to work around bug in IBM C compiler.

===================================================================
RCS file: lib/strtoimax.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -pu -r1.2 -r1.3
--- lib/strtoimax.c     2001/08/29 06:36:20     1.2
+++ lib/strtoimax.c     2001/09/06 19:47:45     1.3
@@ -71,6 +71,8 @@ long long strtoll PARAMS ((char const *,
 #endif
 
 #ifdef UNSIGNED
+# undef HAVE_LONG_LONG
+# define HAVE_LONG_LONG HAVE_UNSIGNED_LONG_LONG
 # define INT uintmax_t
 # define strtoimax strtoumax
 # define strtol strtoul
@@ -82,16 +84,16 @@ long long strtoll PARAMS ((char const *,
 INT
 strtoimax (char const *ptr, char **endptr, int base)
 {
-#if HAVE_UNSIGNED_LONG_LONG
+#if HAVE_LONG_LONG
   verify (size_is_that_of_long_or_long_long,
-         (sizeof (INT) == sizeof strtol (ptr, endptr, base)
-          || sizeof (INT) == sizeof strtoll (ptr, endptr, base)));
+         (sizeof (INT) == sizeof (long)
+          || sizeof (INT) == sizeof (long long)));
 
-  if (sizeof (INT) != sizeof strtol (ptr, endptr, base))
+  if (sizeof (INT) != sizeof (long))
     return strtoll (ptr, endptr, base);
 #else
   verify (size_is_that_of_long,
-         sizeof (INT) == sizeof strtol (ptr, endptr, base));
+         sizeof (INT) == sizeof (long));
 #endif
 
   return strtol (ptr, endptr, base);



reply via email to

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