public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] newlib: strtold: use __builtin_nanl to avoid libm dependency
Date: Wed, 10 Oct 2018 16:04:00 -0000	[thread overview]
Message-ID: <20181010160441.35956.qmail@sourceware.org> (raw)

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

commit 35555851d700a267cca5070e65670c5a5f352d95
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed Oct 10 17:53:55 2018 +0200

    newlib: strtold: use __builtin_nanl to avoid libm dependency
    
    Commit 6c212a8b7873703c4f98c6b68579b234918be83a
    ("Fix strtod ("nan") and strtold ("nan") returns wrong negative NaN")
    introduced an unconditional dependency to nanl and, in turn, to libm.
    
    Rather than including nanl in libc as well, just call __builtin_nanl
    from here.  Requires GCC 3.3 or later.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/stdlib/strtorx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/newlib/libc/stdlib/strtorx.c b/newlib/libc/stdlib/strtorx.c
index a35dabe..4faed85 100644
--- a/newlib/libc/stdlib/strtorx.c
+++ b/newlib/libc/stdlib/strtorx.c
@@ -89,7 +89,7 @@ ULtox(__UShort *L, __ULong *bits, Long exp, int k)
 		break;
 
 	  case STRTOG_NaN:
-		*((long double*)L) = nanl ("");
+		*((long double*)L) = __builtin_nanl ("");
 	  }
 	if (k & STRTOG_Neg)
 		L[_0] |= 0x8000;


                 reply	other threads:[~2018-10-10 16:04 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181010160441.35956.qmail@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).