This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Problem with non-ISO C scalb() builtin
> From: Jim Wilson <wilson@specifixinc.com>
>
> Danny Smith wrote:
> > double scalb (double, double);
> > as in __builtin_scalb
>
> That is a gcc bug. The second argument to scalb should be int to match
> glibc (and presumably the BSD library). This should only be a temporary
> problem.
Er, I don't think it is a gcc bug. The glibc headers on my RH box as
well as math.h on solaris2.7 & irix6.5 and the xopen standard all
describe scalb as taking two doubles. It is scalbn (with an "n") that
takes a double and an int. See:
http://www.opengroup.org/onlinepubs/007904975/functions/scalb.html
vs:
http://www.opengroup.org/onlinepubs/007904975/functions/scalbn.html
I believe in this case your C library is inconsistent with the
standard.
> Is the best thing to do in this case simply to make
> -fno-builtin-scalb the default for mingw32 target?
IMHO, probably yes. (Do you need help with that? Let me know.) You
might also want to submit a fix for scalb to your libc maintainers.
--Kaveh
--
Kaveh R. Ghazi ghazi@caip.rutgers.edu