From patchwork Mon Feb 1 16:26:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jonathan Wakely X-Patchwork-Id: 10687 Received: (qmail 89078 invoked by alias); 1 Feb 2016 16:26:13 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 89067 invoked by uid 89); 1 Feb 2016 16:26:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:2557 X-HELO: mx1.redhat.com Date: Mon, 1 Feb 2016 16:26:09 +0000 From: Jonathan Wakely To: libc-alpha@sourceware.org Cc: Jakub Jelinek , Florian Weimer , Adhemerval Zanella Subject: [patch] Restore isinf, isinfl, isnanf and isnanl for C++11 Message-ID: <20160201162609.GG3471@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.5.24 (2015-08-30) It was pointed out to me that my patch for BZ #19439 (committed as d9b965fa56350d6eea9f7f438a0714c7ffbb183f on Jan 11) does more than I intended it to. Only the double versions of isinf and isnan conflict with C++11 functions, but my patch also prevents the long double and float versions from being declared. C++11 code using isinf and isnan continues to compile after that change, because the C++11 standard library provides its own versions conforming to the C++11 requirements. However, the C++11 library doesn't provide isinff, isinfl etc. and so code using those (non-standard) functions will no longer compile if they are not declared by glibc. This patch tweaks my change so that only the isinf(double) and isnan(double) declarations are suppressed, and the float and long double versions are still declared, even for C++11. We would like this to get into 2.23 as well, so that only the problematic functions that conflict with C++11 get removed in glibc 2.23, and the other functions remain. Sorry for the unintended consequences of my previous patch. commit 48746aa5a013aab5ca89ee8c29761baec8850c0f Author: Jakub Jelinek Date: Mon Feb 1 16:17:55 2016 +0000 Restore isinf, isinfl, isnanf and isnanl for C++11 diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h index a48345d..9a7b3f0 100644 --- a/math/bits/mathcalls.h +++ b/math/bits/mathcalls.h @@ -196,7 +196,9 @@ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__)); _Mdouble_END_NAMESPACE #ifdef __USE_MISC -# if !defined __cplusplus || __cplusplus < 201103L /* Conflicts with C++11. */ +# if (!defined __cplusplus \ + || __cplusplus < 201103L /* isinf conflicts with C++11. */ \ + || __MATH_DECLARING_DOUBLE == 0) /* isinff or isinfl don't. */ /* Return 0 if VALUE is finite or NaN, +1 if it is +Infinity, -1 if it is -Infinity. */ __MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__)); @@ -232,7 +234,9 @@ __END_NAMESPACE_C99 __MATHDECL_1 (int,__isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); #if defined __USE_MISC || (defined __USE_XOPEN && !defined __USE_XOPEN2K) -# if !defined __cplusplus || __cplusplus < 201103L /* Conflicts with C++11. */ +# if (!defined __cplusplus \ + || __cplusplus < 201103L /* isnan conflicts with C++11. */ \ + || __MATH_DECLARING_DOUBLE == 0) /* isnanf or isnanl don't. */ /* Return nonzero if VALUE is not a number. */ __MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__)); # endif