PATCH: Use __LONG_LONG_MAX__ if LONG_LONG_MIN etc are not available

Loren James Rittle rittle@latour.rsch.comm.mot.com
Tue Jul 31 12:34:00 GMT 2001


>> The problem is described in
>> http://gcc.gnu.org/ml/gcc-bugs/2001-07/msg01112.html

> It means your bits/std_limits.h was created incorrectly.  [...]

By request of the primary author of the file (thanks Gabriel and
Benjamin for the quick responses) and since I couldn't think of any
good reason to be so conservative after looking at the situation, the
substitution will be made unconditionally.

The only issue I see is that people trying to use libstdc++-v3 without
gcc and with _GLIBCPP_USE_LONG_LONG defined might now have to ensure
that __LONG_LONG_MAX__ is defined.

This version of the patch was tested on i386-unknown-freebsd4.3
against both mainline and 3.0 branch by rebuilding libstdc++-v3 (even
though configure will not normally allow it on this target, tested
with _GLIBCPP_USE_LONG_LONG defined as well) and then installed.

No regressions seen but I might have expected some when
_GLIBCPP_USE_LONG_LONG was defined on i386-unknown-freebsd4.3 since we
are missing some of the required C99 entry points...

This is the path of logic which was known to fix the current bootstrap
problem on armv4l-*-linux-gnu but I haven't retested it there myself.

2001-07-31  Loren J. Rittle  <ljrittle@acm.org>

	* src/gen-num-limits.cc:  Use __LONG_LONG_MAX__.

Index: src/gen-num-limits.cc
===================================================================
RCS file: /cvs/gcc/egcs/libstdc++-v3/src/gen-num-limits.cc,v
retrieving revision 1.13
diff -c -r1.13 gen-num-limits.cc
*** gen-num-limits.cc	2001/07/20 00:09:31	1.13
--- gen-num-limits.cc	2001/07/31 18:36:03
***************
*** 373,380 ****
  DEFINE_EXTREMA(long, LONG_MIN, LONG_MAX);
  DEFINE_EXTREMA(unsigned long, 0, ULONG_MAX);
  #ifdef _GLIBCPP_USE_LONG_LONG
! DEFINE_EXTREMA(long long, LONG_LONG_MIN, LONG_LONG_MAX);
! DEFINE_EXTREMA(unsigned long long, 0, ULONG_LONG_MAX);
  #endif
  DEFINE_EXTREMA(float, FLT_MIN, FLT_MAX);
  DEFINE_EXTREMA(double, DBL_MIN, DBL_MAX);
--- 373,380 ----
  DEFINE_EXTREMA(long, LONG_MIN, LONG_MAX);
  DEFINE_EXTREMA(unsigned long, 0, ULONG_MAX);
  #ifdef _GLIBCPP_USE_LONG_LONG
! DEFINE_EXTREMA(long long, (-__LONG_LONG_MAX__-1), __LONG_LONG_MAX__);
! DEFINE_EXTREMA(unsigned long long, 0, (__LONG_LONG_MAX__ * 2ULL + 1));
  #endif
  DEFINE_EXTREMA(float, FLT_MIN, FLT_MAX);
  DEFINE_EXTREMA(double, DBL_MIN, DBL_MAX);



More information about the Gcc-patches mailing list