This is the mail archive of the cygwin-cvs@cygwin.com mailing list for the Cygwin 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]

[newlib-cygwin] Avoid truncating from long double to double in sinhl().


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=113abc27a6df3325f024aa2c5aff30126cfeb247

commit 113abc27a6df3325f024aa2c5aff30126cfeb247
Author: David Wohlferd <dw@LimeGreenSocks.com>
Date:   Mon Aug 22 00:51:12 2016 -0700

    Avoid truncating from long double to double in sinhl().
    
    This routine makes a call to fabs instead of fabsl(), causing truncation.
    
    Clang complains (warning: absolute value function 'fabs' given an argument of type 'long double' but has parameter of type 'double' which may cause truncation of value).
    
    Signed-off-by: David Wohlferd <dw@LimeGreenSocks.com>

Diff:
---
 winsup/cygwin/math/sinhl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/winsup/cygwin/math/sinhl.c b/winsup/cygwin/math/sinhl.c
index f6ecef0..4db0e51 100644
--- a/winsup/cygwin/math/sinhl.c
+++ b/winsup/cygwin/math/sinhl.c
@@ -67,7 +67,7 @@ long double sinhl(long double x)
   if (x_class == FP_ZERO)
     return x;
   if (x_class == FP_INFINITE ||
-      (fabs (x) > (MAXLOGL + LOGE2L)))
+      (fabsl (x) > (MAXLOGL + LOGE2L)))
   {
     errno = ERANGE;
 #ifdef INFINITIES


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