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]
Other format: [Raw text]

Re: 3 new fails with builtin patch


Benjamin Kosnik wrote:

>I now see these when doing 'make check' after:
>
>2002-03-28  Roger Sayle  <roger@eyesopen.com>
>
>	* include/c_std/std_cmath.h:  To prevent problems overloading
>	g++ builtins, use the double variants from the global namespace
>	before defining float and long double variants in std::.
>
>
>FAIL: 26_numerics/complex_value.cc (test for excess errors)
>WARNING: 26_numerics/complex_value.cc compilation failed to produce executable
>FAIL: 26_numerics/valarray.cc (test for excess errors)
>WARNING: 26_numerics/valarray.cc compilation failed to produce executable
>FAIL: 27_io/ostream_inserter_arith.cc (test for excess errors)
>WARNING: 27_io/ostream_inserter_arith.cc compilation failed to produce executable
>
A little bit more of analysis. Consider:

namespace std
{
  inline double
  abs(double __x)
  { return __builtin_fabs(__x); }
}

int main()
{
  double num = 1.234;
  std::abs(num);
}

/tmp/ccKJFSrV.o: In function `main':
/tmp/ccKJFSrV.o(.text+0x2c): undefined reference to `std::abs(double)'
collect2: ld returned 1 exit status

OTOH:

namespace std
{
  double
  abs(double __x)
  { return __builtin_fabs(__x); }
}

int main()
{
  double num = 1.234;
  std::abs(num);
}

This is Ok! As is the first one if compiled -O. Therefore, it looks like 
the problem mentioned in 
http://gcc.gnu.org/ml/libstdc++/2002-03/msg00460.html about inline 
declarations is still there.

Ciao, Paolo.





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