On Thu, Oct 19, 2006 at 01:56:24PM -0400, Tom Lane wrote:
> Is it worth renaming our qsort to pg_qsort to avoid this? (I'd be
> inclined to do that via a macro "#define qsort pg_qsort", not by running
> around and changing all the code.)
Redefining a function that is defined in POSIX and present on most
systems seems like a bad idea. Not in the least because ELF linking
rules mean that if any library (say libssl) in the backend calls qsort,
they'll get the postgresql one, rather than the C library like they
expect. That seems fragile to me.
The #define would be fine, as long as you make sure it's called after
the system headers, otherwise the problem isn't fixed.
Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.