summaryrefslogtreecommitdiff
path: root/ChangeLog
diff options
context:
space:
mode:
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-01-11 13:34:52 -0200
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>2016-01-11 17:13:36 -0200
commitd9b965fa56350d6eea9f7f438a0714c7ffbb183f (patch)
treed62ed49512fbc76c0f08ff977f51735cf49586dd /ChangeLog
parentc83196b0df4340209f260ffaf90e787c711c268e (diff)
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.
Diffstat (limited to 'ChangeLog')
-rw-r--r--ChangeLog9
1 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 600c3dd501..08a05bfb7d 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]