Re: cleanup of cbrt() handling - Mailing list pgsql-patches

From Tom Lane
Subject Re: cleanup of cbrt() handling
Date
Msg-id 5575.1053874631@sss.pgh.pa.us
Whole thread Raw
In response to Re: cleanup of cbrt() handling  (Bruce Momjian <pgman@candle.pha.pa.us>)
Responses Re: cleanup of cbrt() handling  (Bruce Momjian <pgman@candle.pha.pa.us>)
List pgsql-patches
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>     #ifndef HAVE_CBRT
>     #define cbrt my_cbrt
>     static double cbrt(double x);

>     #else
>     #if !defined(nextstep)
>     extern double cbrt(double x);
>     #endif
>     #endif   /* HAVE_CBRT */

> There is no my_cbrt() function, meaning anyone who didn't have cbrt
> couldn't have even compiled 7.3, so I think we should just remove
> cbrt,

No, you're misreading the point of the code.  The #define changes the
spelling of the static declaration.  The idea evidently is to make sure
that there is no conflict of the static function against a library
cbrt(), on the off chance that configure missed finding it somehow.
This might be overly tricky --- certainly we do not take comparable
precautions for other library-substitute functions.  I wouldn't object
to removing the "#define cbrt my_cbrt".  But you have *no* proof that
removing the whole thing won't break some supported platform.

            regards, tom lane

pgsql-patches by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: cleanup of cbrt() handling
Next
From: Tom Lane
Date:
Subject: Re: updated win32 patch