This is the mail archive of the gcc-bugs@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]
Other format: [Raw text]

Re: Problem with non-ISO C scalb() builtin


 --- "Kaveh R. Ghazi" <ghazi@caip.rutgers.edu> wrote: >  > 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.

No.  It is consistent with ANSI std, not XOPEN.  If
you look in newlib, there is allowance for both versions of scalb
> 
>  > 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.
> 
Umm, libc in mingw32 case is MSVCRT.dll.  I don't think MS will change
anything just for the benefit of mingw32. But I could just delete declaration
of scalb in mingw32's math.h, leaving the underscored _scalb declaration in place
(perhaps with _attribute__((__deprecated__)).

Should -std=c89 or -std=c99 imply -fno-nonansi-builtins

Danny

> 		--Kaveh
> --
> Kaveh R. Ghazi			ghazi@caip.rutgers.edu 

http://search.yahoo.com.au - Yahoo! Search
- Looking for more? Try the new Yahoo! Search


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