From patchwork Mon Apr 4 20:51:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaakov Selkowitz X-Patchwork-Id: 65030 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp96484lbc; Mon, 4 Apr 2016 13:51:53 -0700 (PDT) X-Received: by 10.66.176.139 with SMTP id ci11mr55935549pac.68.1459803113835; Mon, 04 Apr 2016 13:51:53 -0700 (PDT) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id fh8si2425415pab.5.2016.04.04.13.51.53 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 04 Apr 2016 13:51:53 -0700 (PDT) Received-SPF: pass (google.com: domain of newlib-return-13447-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of newlib-return-13447-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=newlib-return-13447-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; q=dns; s=default; b=M/2ZlPo2SPmki72pExjTg3wp7dkq6zH Nd9jJz4zqe5DpjF2W2O8WCHtr+0tM8kZ1wu6+EAXWnz0tHSKKctcZi1qhmJuXsU7 mqwFpkijlZFlO9MCBm/2CCPHgTrQX7s4VmrHltXa9hprSvEW5cFVjImj0fbhCdW5 NjUfviz6E6fs= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:in-reply-to :references; s=default; bh=a9KcAH9bWpAR0f+fylscBoqe114=; b=LCHO+ C2XfBYqIaNoI8DAUP8M8kGVctwMbt39c1ltyFG2ZuVHNKI+MHeW+uS7gv6K7Rdss 2fWKyVHBFxtmEwcRKyG4K27DlNACAUN1EiOqQVlIKP4PU9c5AgfQbQ98VOABT6Id /uZH+l5tZtE7toZpLp1jc3JBKdzN2ZFTqFb1w8= Received: (qmail 123527 invoked by alias); 4 Apr 2016 20:51:44 -0000 Mailing-List: contact newlib-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: newlib-owner@sourceware.org Delivered-To: mailing list newlib@sourceware.org Received: (qmail 123512 invoked by uid 89); 4 Apr 2016 20:51:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=BAYES_00, NORMAL_HTTP_TO_IP, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Specification, 1818, 0*, 3, 9 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 04 Apr 2016 20:51:33 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4B260811A7 for ; Mon, 4 Apr 2016 20:51:32 +0000 (UTC) Received: from localhost.localdomain (ovpn-116-26.rdu2.redhat.com [10.10.116.26]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u34KpVTP028712 (version=TLSv1/SSLv3 cipher=AES256-SHA256 bits=256 verify=NO) for ; Mon, 4 Apr 2016 16:51:31 -0400 From: Yaakov Selkowitz To: newlib@sourceware.org Subject: [PATCH] math: update isinf/isnan function comments after move to math.h Date: Mon, 4 Apr 2016 15:51:15 -0500 Message-Id: <1459803075-11816-1-git-send-email-yselkowi@redhat.com> In-Reply-To: <5702CBB1.10507@cygwin.com> References: <5702CBB1.10507@cygwin.com> Signed-off-by: Yaakov Selkowitz --- newlib/libc/include/math.h | 2 +- newlib/libm/common/s_isinf.c | 5 ++--- newlib/libm/common/s_isnan.c | 14 ++++++++------ newlib/libm/common/s_isnand.c | 8 ++++---- newlib/libm/common/sf_isinf.c | 5 ++--- newlib/libm/common/sf_isnan.c | 2 +- newlib/libm/machine/spu/sf_isinf.c | 2 +- 7 files changed, 19 insertions(+), 19 deletions(-) -- 2.7.4 diff --git a/newlib/libc/include/math.h b/newlib/libc/include/math.h index 798fc6d..80a8048 100644 --- a/newlib/libc/include/math.h +++ b/newlib/libc/include/math.h @@ -228,7 +228,7 @@ extern int __signbitd (double x); * supporting multiple floating point types. Thus, they are * now defined as macros. Implementations of the old functions * taking double arguments still exist for compatibility purposes - * (prototypes for them are in ). */ + * (prototypes for them are earlier in this header). */ #if __GNUC_PREREQ (4, 4) #define fpclassify(__x) (__builtin_fpclassify (FP_NAN, FP_INFINITE, \ diff --git a/newlib/libm/common/s_isinf.c b/newlib/libm/common/s_isinf.c index db8e8f8..f22acb7 100644 --- a/newlib/libm/common/s_isinf.c +++ b/newlib/libm/common/s_isinf.c @@ -4,9 +4,8 @@ * * isinf is a macro in the C99 standard. It was previously * implemented as a function by newlib and is declared as such in - * . Newlib supplies it here as a function if the user - * chooses to use or needs to link older code compiled with the - * previous declaration. + * . Newlib supplies it here as a function if the user + * chooses to use it instead of the C99 macro. */ #include "fdlibm.h" diff --git a/newlib/libm/common/s_isnan.c b/newlib/libm/common/s_isnan.c index 3ce5aa6..64deacd 100644 --- a/newlib/libm/common/s_isnan.c +++ b/newlib/libm/common/s_isnan.c @@ -53,7 +53,7 @@ ANSI_SYNOPSIS int isnormal(real-floating <[x]>); [Archaic SUSv2 functions:] - #include + #include int isnan(double <[arg]>); int isinf(double <[arg]>); int finite(double <[arg]>); @@ -142,7 +142,7 @@ o- and <> are macros that operate on multiple types of floating-point. The SUSv2 standard declares <> as a function taking double. Newlib has decided to declare - them both as macros in math.h and as functions in ieeefp.h to + them both as functions and as macros in math.h to maintain backward compatibility. RETURNS @@ -154,9 +154,11 @@ The isnan macro returns nonzero if <[x]> is an NaN, else 0.@* The isnormal macro returns nonzero if <[x]> has a normal value, else 0. PORTABILITY -math.h macros are C99, POSIX. +math.h macros are C99, POSIX.1-2001. -ieeefp.h funtions are outdated and should be avoided. +The functions originate from BSD; isnan was listed in the X/Open +Portability Guide and Single Unix Specification, but was dropped when +the macro was standardized in POSIX.1-2001. QUICKREF isnan - pure @@ -179,8 +181,8 @@ QUICKREF * The C99 standard dictates that isnan is a macro taking * multiple floating-point types while the SUSv2 standard * notes it is a function taking a double argument. Newlib - * has chosen to implement it as a macro in and - * declare it as a function in . + * has chosen to declare it both as a function and as a macro in + * for compatibility. */ #include "fdlibm.h" diff --git a/newlib/libm/common/s_isnand.c b/newlib/libm/common/s_isnand.c index 75538d9..0ac8c59 100644 --- a/newlib/libm/common/s_isnand.c +++ b/newlib/libm/common/s_isnand.c @@ -28,7 +28,7 @@ INDEX finitef ANSI_SYNOPSIS - #include + #include int isnan(double <[arg]>); int isinf(double <[arg]>); int finite(double <[arg]>); @@ -37,7 +37,7 @@ ANSI_SYNOPSIS int finitef(float <[arg]>); TRAD_SYNOPSIS - #include + #include int isnan(<[arg]>) double <[arg]>; int isinf(<[arg]>) @@ -77,8 +77,8 @@ DESCRIPTION Note that by the C99 standard, <> and <> are macros taking any type of floating-point and are declared in - <>. Newlib has chosen to declare these as macros in - <> and as functions in <>. + <>. Newlib has chosen to declare these both as functions + and as macros in <>. The <>, <> and <> functions perform the same operations as their <>, <> and <> diff --git a/newlib/libm/common/sf_isinf.c b/newlib/libm/common/sf_isinf.c index 6595a68..5b57a34 100644 --- a/newlib/libm/common/sf_isinf.c +++ b/newlib/libm/common/sf_isinf.c @@ -3,9 +3,8 @@ * * isinf is a macro in the C99 standard. It was previously * implemented as isinf and isinff functions by newlib and are still declared - * as such in . Newlib supplies it here as a function if the user - * chooses to use or needs to link older code compiled with the - * previous declaration. + * as such in . Newlib supplies it here as a function if the user + * chooses to use it instead of the C99 macro. */ #include "fdlibm.h" diff --git a/newlib/libm/common/sf_isnan.c b/newlib/libm/common/sf_isnan.c index ddda6b3..9c813fc 100644 --- a/newlib/libm/common/sf_isnan.c +++ b/newlib/libm/common/sf_isnan.c @@ -15,7 +15,7 @@ /* * isnanf(x) returns 1 is x is nan, else 0; * - * isnanf is an extension declared in . + * isnanf is an extension declared in . */ #include "fdlibm.h" diff --git a/newlib/libm/machine/spu/sf_isinf.c b/newlib/libm/machine/spu/sf_isinf.c index 3c5f8d8..6460ec1 100644 --- a/newlib/libm/machine/spu/sf_isinf.c +++ b/newlib/libm/machine/spu/sf_isinf.c @@ -34,7 +34,7 @@ /* * On the SPU isinff(x) always returns 0. * - * isinff is an extension declared in . + * isinff is an extension declared in . */ int isinff (float x)