Builtins in `std'

Andreas Jaeger aj@suse.de
Wed May 23 00:27:00 GMT 2001


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



More information about the Gcc mailing list