This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


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

libstdc++-2.90.8 does not compile on HP-UX (mknumeric-limits)


gen-num-limits.cc does not link correctly on HP-UX 10 or 11.  The problem is that the linker requires that unreferenced class members have to be defined.  I ended up defining epsilon and round_error for the various standard types as follows:

*** libstdc++-2.90.8/src/gen-num-limits.cc.orig	Fri Mar 24 13:18:57 2000
--- libstdc++-2.90.8/src/gen-num-limits.cc	Mon Jun 11 08:28:37 2001
***************
*** 376,381 ****
--- 376,391 ----
  #define SPECIALIZE_EPSILON(T, E) DO_SPECIALIZE_EPSILON(T, E)
  #define DO_SPECIALIZE_EPSILON(T, E) const char value< T >::epsilon[] = #E
  
+ const char value<bool>::epsilon[] = "0";
+ const char value<int>::epsilon[] = "0";
+ const char value<unsigned int>::epsilon[] = "0";
+ const char value<short>::epsilon[] = "0";
+ const char value<unsigned short>::epsilon[] = "0";
+ const char value<long>::epsilon[] = "0";
+ const char value<unsigned long>::epsilon[] = "0";
+ const char value<char>::epsilon[] = "0";
+ const char value<signed char>::epsilon[] = "0";
+ const char value<unsigned char>::epsilon[] = "0";
  SPECIALIZE_EPSILON(float, FLT_EPSILON);
  SPECIALIZE_EPSILON(double, DBL_EPSILON);
  SPECIALIZE_EPSILON(long double, LDBL_EPSILON);
***************
*** 386,391 ****
--- 396,411 ----
  
  #define SPECIALIZE_ROUND_ERROR(T, R) const char value< T >::round_error[] = #R
  
+ const char value<bool>::round_error[] = "0";
+ const char value<int>::round_error[] = "0";
+ const char value<unsigned int>::round_error[] = "0";
+ const char value<short>::round_error[] = "0";
+ const char value<unsigned short>::round_error[] = "0";
+ const char value<long>::round_error[] = "0";
+ const char value<unsigned long>::round_error[] = "0";
+ const char value<char>::round_error[] = "0";
+ const char value<signed char>::round_error[] = "0";
+ const char value<unsigned char>::round_error[] = "0";
  SPECIALIZE_ROUND_ERROR(float, 1.0f);
  SPECIALIZE_ROUND_ERROR(double, 1.0);
  SPECIALIZE_ROUND_ERROR(long double, 1.0L);

HP-UX 11.00 also defines nan(const char *) in the standard C library, interfering with libstdc++-2.90.8 (math.h problems).  I seem to be able to make it work on HP-UX 10 with the gen-num-limits.cc changes, but so far not on 11.

/Joe


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