This is the mail archive of the
glibc-cvs@sourceware.org
mailing list for the glibc project.
GNU C Library master sources branch master updated. glibc-2.22-662-gd9b965f
- From: azanella at sourceware dot org
- To: glibc-cvs at sourceware dot org
- Date: 11 Jan 2016 19:14:44 -0000
- Subject: GNU C Library master sources branch master updated. glibc-2.22-662-gd9b965f
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU C Library master sources".
The branch, master has been updated
via d9b965fa56350d6eea9f7f438a0714c7ffbb183f (commit)
from c83196b0df4340209f260ffaf90e787c711c268e (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=d9b965fa56350d6eea9f7f438a0714c7ffbb183f
commit d9b965fa56350d6eea9f7f438a0714c7ffbb183f
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date: Mon Jan 11 13:34:52 2016 -0200
Fix isinf/isnan declaration conflict with C++11
GLIBC declares isinf and isnan as expected by Unix98 and for C99 programs
these functions are hidden by the generics inf and isnan macros.
However C++11 defines isinf and isnan with the same semantics as C99
but requires that they are functions not macros (C++11 26.8 [c.math]
paragraph 10).
This then results in a conflict for perfectly valid C++11 programs:
--
using std::isinf;
using std::isnan;
double d1 = isinf(1.0);
double d2 = isnan(1.0);
d.cc:3:12: error: â??constexpr bool std::isinf(double)â?? conflicts with a previous declaration
using std::isinf;
[...]
/usr/include/bits/mathcalls.h:201:1: note: previous declaration â??int isinf(double)â??
__MATHDECL_1 (int,isinf,, (_Mdouble_ __value)) __attribute__ ((__const__));
[...]
--
This patch fixes the prototypes by leaving the obsolete functions
defined for C++98 code (since they do not conflict with any standard
function in C++98), however preventing them on C++11.
No issues found in libstdc++ tests and check on x86_64 and i686 with
glibc testsuite.
Patch from Jonathan Wakely <jwakely.gcc@gmail.com>.
[BZ #19439]
* math/bits/mathcalls.h
[!__cplusplus || __cplusplus < 201103L] (isinf): Do not declare
prototype.
[!__cplusplus || __cplusplus < 201103L] (isnan): Likewise.
diff --git a/ChangeLog b/ChangeLog
index 600c3dd..08a05bf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2016-01-11 Jonathan Wakely <jwakely.gcc@gmail.com>
+ Adhemerval Zanella <adhemerval.zanella@linaro.org>
+
+ [BZ #19439]
+ * math/bits/mathcalls.h
+ [!__cplusplus || __cplusplus < 201103L] (isinf): Do not declare
+ prototype.
+ [!__cplusplus || __cplusplus < 201103L] (isnan): Likewise.
+
2016-01-11 Andreas Schwab <schwab@suse.de>
[BZ #19253]
diff --git a/math/bits/mathcalls.h b/math/bits/mathcalls.h
index b82c373..a48345d 100644
--- a/math/bits/mathcalls.h
+++ b/math/bits/mathcalls.h
@@ -196,9 +196,11 @@ __MATHDECL_1 (int,__finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
_Mdouble_END_NAMESPACE
#ifdef __USE_MISC
+# if !defined __cplusplus || __cplusplus < 201103L /* Conflicts with C++11. */
/* 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__));
+# endif
/* Return nonzero if VALUE is finite and not NaN. */
__MATHDECL_1 (int,finite,, (_Mdouble_ __value)) __attribute__ ((__const__));
@@ -230,8 +232,10 @@ __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. */
/* Return nonzero if VALUE is not a number. */
__MATHDECL_1 (int,isnan,, (_Mdouble_ __value)) __attribute__ ((__const__));
+# endif
#endif
#if defined __USE_MISC || (defined __USE_XOPEN && __MATH_DECLARING_DOUBLE)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 9 +++++++++
math/bits/mathcalls.h | 4 ++++
2 files changed, 13 insertions(+), 0 deletions(-)
hooks/post-receive
--
GNU C Library master sources