[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Re2: coreutils v5.2.1 - stat.c
From: |
Paul Eggert |
Subject: |
Re: Re2: coreutils v5.2.1 - stat.c |
Date: |
Wed, 28 Sep 2005 15:13:06 -0700 |
User-agent: |
Gnus/5.1007 (Gnus v5.10.7) Emacs/21.4 (gnu/linux) |
ThMO <address@hidden> writes:
> ยท even though the C compiler might be able to deal with 64-bit integer values,
> this must *not* be the case with the C pre-processor:
>
> #define ULLONG_MAX 18446744073709551615ULL
>
> the C compiler (gcc v2.7.2.1) *is* able to deal with that value, but the
> cpp can't
Ouch. Thanks for reporting the problem; this is due, I think, to a
change installed in January. Can you please try the following private
snapshot instead?
http://www.cs.ucla.edu/~eggert/coreutils-5.3.1-20050928-eggert.tar.gz
It has the following patch installed (which I also installed into CVS
coreutils):
2005-09-28 Paul Eggert <address@hidden>
* m4/ullong_max.m4 (gl_ULLONG_MAX): Simplify so that it merely
defines ULONG_MAX_LT_ULLONG_MAX. Thomas M.Ott reports that
ULLONG_MAX doesn't work with 2.7.2.1.
* src/system.h (LONGEST_MODIFIER): Use ULONG_MAX_LT_ULLONG_MAX
instead of ULLONG_MAX, as the latter doesn't work with GCC 2.7.2.1.
Index: m4/ullong_max.m4
===================================================================
RCS file: /fetish/cu/m4/ullong_max.m4,v
retrieving revision 1.2
diff -p -u -r1.2 ullong_max.m4
--- m4/ullong_max.m4 22 Jan 2005 06:25:53 -0000 1.2
+++ m4/ullong_max.m4 28 Sep 2005 22:04:09 -0000
@@ -11,36 +11,17 @@ AC_DEFUN([gl_ULLONG_MAX],
[
dnl Avoid _AC_COMPUTE_INT-related macros, as they may not work with
dnl types wider than long int, due to problems with expr.
- AC_CACHE_CHECK([for ULLONG_MAX], gl_cv_ullong_max,
- [gl_cv_ullong_max=no
- AC_EGREP_CPP([ULLONG_MAX is defined],
- [
- #include <limits.h>
- #ifdef ULLONG_MAX
- "ULLONG_MAX is defined"
- #endif
- ],
- [gl_cv_ullong_max=yes])
- case $gl_cv_ullong_max in
- no)
- for gl_expr in \
- 18446744073709551615ULL \
- 4722366482869645213695ULL \
- 340282366920938463463374607431768211455ULL
- do
- AC_TRY_COMPILE([],
- [char test[$gl_expr == (unsigned long long int) -1 ? 1 : -1];
- static unsigned long long int i = $gl_expr;
- return i && test;],
- [gl_cv_ullong_max=$gl_expr])
- test $gl_cv_ullong_max != no && break
- done
- esac])
- case $gl_cv_ullong_max in
- yes | no) ;;
- *)
- AC_DEFINE_UNQUOTED([ULLONG_MAX], [$gl_cv_ullong_max],
- [Define as the maximum value of the type 'unsigned long long int',
- if the system doesn't define it, and if the system has that type.]);;
- esac
+ AC_CACHE_CHECK([whether ULONG_MAX < ULLONG_MAX],
+ [gl_cv_ulong_max_lt_ullong_max],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_BOOL_COMPILE_TRY(
+ [AC_INCLUDES_DEFAULT],
+ [[(unsigned long int) -1 < (unsigned long long int) -1]])],
+ [gl_cv_ulong_max_lt_ullong_max=yes],
+ [gl_cv_ulong_max_lt_ullong_max=no])])
+ if test $gl_cv_ulong_max_lt_ullong_max = yes; then
+ AC_DEFINE([ULONG_MAX_LT_ULLONG_MAX], 1,
+ [Define if ULONG_MAX < ULLONG_MAX, even if your compiler does not
+ support ULLONG_MAX.])
+ fi
])
Index: src/system.h
===================================================================
RCS file: /fetish/cu/src/system.h,v
retrieving revision 1.136
diff -p -u -r1.136 system.h
--- src/system.h 23 Sep 2005 20:35:41 -0000 1.136
+++ src/system.h 28 Sep 2005 22:04:09 -0000
@@ -316,7 +316,7 @@ initialize_exit_failure (int status)
# include <stdint.h>
#endif
-#if ULONG_MAX < ULLONG_MAX
+#if ULONG_MAX_LT_ULLONG_MAX
# define LONGEST_MODIFIER "ll"
#else
# define LONGEST_MODIFIER "l"
- coreutils v5.2.1 - stat.c, ThMO, 2005/09/26
- Re: coreutils v5.2.1 - stat.c, Bob Proulx, 2005/09/26
- Re3: coreutils v5.2.1 - stat.c, ThMO, 2005/09/29
- Re: Re3: coreutils v5.2.1 - stat.c, Paul Eggert, 2005/09/29
- Re4: coreutils v5.2.1 - stat.c, ThMO, 2005/09/29
- Re: Re4: coreutils v5.2.1 - stat.c, Paul Eggert, 2005/09/29
- coreutils man pages "info sort" -> "info coreutils sort", Paul Eggert, 2005/09/29
- Re: coreutils man pages "info sort" -> "info coreutils sort", Jim Meyering, 2005/09/29