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


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

Re: Builtins in `std'


Gabriel Dos Reis <gdr@codesourcery.com> writes:

> Mark Mitchell <mark@codesourcery.com> writes:
> | In particular, I'm trying to fix a regression on code like:
> | 
> |   extern "C" double fabs (double) {}
> | 
> |   namespace std { 
> |     double fabs (double) {}
> |   } 
> | 
> | (A user is allowed to do this; they might have a different library
> | implementation or something.)
> 
> The above is not allowed.

What is not allowed in this?  In glibc's mathinline.h (included via
<math.h> we have:

extern "C" {
inline double fabs (double) throw ()  { return __builtin_fabs (__x); }
}

and it bits/std_cmath.h also does:
namespace std
{
  inline float
  fabs(float __x) { return __builtin_fabsf(__x); }
}

Is this a problem?

Andreas
-- 
 Andreas Jaeger
  SuSE Labs aj@suse.de
   private aj@arthur.inka.de
    http://www.suse.de/~aj


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