This is the mail archive of the glibc-cvs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

GNU C Library master sources branch release/2.26/master updated. glibc-2.26-11-g5e989c3


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, release/2.26/master has been updated
       via  5e989c36934d0f0cf13b7a53ef2fa440bce39210 (commit)
       via  c2921b17a37e887b8a5ca9d84b875b9ba702b79c (commit)
      from  645b7635ba8fd58062245419e8bb668ab90cd3ec (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=5e989c36934d0f0cf13b7a53ef2fa440bce39210

commit 5e989c36934d0f0cf13b7a53ef2fa440bce39210
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Mon Aug 14 17:51:51 2017 -0300

    Do not use generic selection in C++ mode
    
    The logic to protect the use of generic selection (_Generic) does not
    check for C or C++ mode, however, generic selection is a C-only
    feature.
    
    Tested for powerpc64le.
    
    	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): Define to 0, if
    	in C++ mode.
    
    (cherry picked from commit 6913ad65e00bb32417ad39c41d292b976171e27e)

diff --git a/ChangeLog b/ChangeLog
index 415fa3c..23c00ae 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2017-08-18  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
+	* misc/sys/cdefs.h (__HAVE_GENERIC_SELECTION): Define to 0, if
+	in C++ mode.
+
+2017-08-18  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
 	[BZ #21930]
 	* math/math.h (isinf): Check if in C or C++ mode before using
 	__builtin_types_compatible_p, since this is a C mode feature.
diff --git a/misc/sys/cdefs.h b/misc/sys/cdefs.h
index 06523bf..0c80821 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -464,17 +464,18 @@
 # define __glibc_macro_warning(msg)
 #endif
 
-/* Support for generic selection (ISO C11) is available in GCC since
-   version 4.9.  Previous versions do not provide generic selection,
-   even though they might set __STDC_VERSION__ to 201112L, when in
-   -std=c11 mode.  Thus, we must check for !defined __GNUC__ when
-   testing __STDC_VERSION__ for generic selection support.
+/* Generic selection (ISO C11) is a C-only feature, available in GCC
+   since version 4.9.  Previous versions do not provide generic
+   selection, even though they might set __STDC_VERSION__ to 201112L,
+   when in -std=c11 mode.  Thus, we must check for !defined __GNUC__
+   when testing __STDC_VERSION__ for generic selection support.
    On the other hand, Clang also defines __GNUC__, so a clang-specific
    check is required to enable the use of generic selection.  */
-#if __GNUC_PREREQ (4, 9) \
-    || __glibc_clang_has_extension (c_generic_selections) \
-    || (!defined __GNUC__ && defined __STDC_VERSION__ \
-	&& __STDC_VERSION__ >= 201112L)
+#if !defined __cplusplus \
+    && (__GNUC_PREREQ (4, 9) \
+	|| __glibc_clang_has_extension (c_generic_selections) \
+	|| (!defined __GNUC__ && defined __STDC_VERSION__ \
+	    && __STDC_VERSION__ >= 201112L))
 # define __HAVE_GENERIC_SELECTION 1
 #else
 # define __HAVE_GENERIC_SELECTION 0

http://sourceware.org/git/gitweb.cgi?p=glibc.git;a=commitdiff;h=c2921b17a37e887b8a5ca9d84b875b9ba702b79c

commit c2921b17a37e887b8a5ca9d84b875b9ba702b79c
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Mon Aug 21 14:23:27 2017 +0200

    Do not use __builtin_types_compatible_p in C++ mode (bug 21930)
    
    The logic to define isinf for float128 depends on the availability of
    __builtin_types_compatible_p, which is only available in C mode,
    however, the conditionals do not check for C or C++ mode.  This lead to
    an error in libstdc++ configure, as reported by bug 21930.
    
    This patch adds a conditional for C mode in the definition of isinf for
    float128.  No definition is provided in C++ mode, since libstdc++
    headers undefine isinf.
    
    Tested for powerpc64le (glibc test suite and libstdc++-v3 configure).
    
    	[BZ #21930]
    	* math/math.h (isinf): Check if in C or C++ mode before using
    	__builtin_types_compatible_p, since this is a C mode feature.
    
    (cherry picked from commit 47a67213a9f51c5f8816d240500b10db605d8b77)

diff --git a/ChangeLog b/ChangeLog
index 6886cd9..415fa3c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-08-18  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
+
+	[BZ #21930]
+	* math/math.h (isinf): Check if in C or C++ mode before using
+	__builtin_types_compatible_p, since this is a C mode feature.
+
 2017-08-10  Gabriel F. T. Gomes  <gftg@linux.vnet.ibm.com>
 
 	[BZ #21941]
diff --git a/NEWS b/NEWS
index d57c405..75b82c8 100644
--- a/NEWS
+++ b/NEWS
@@ -11,6 +11,7 @@ The following bugs are resolved with this release:
 
   [21242] assert: Suppress pedantic warning caused by statement expression
   [21885] getaddrinfo: Release resolver context on error in gethosts
+  [21930] Do not use __builtin_types_compatible_p in C++ mode
   [21932] Unpaired __resolv_context_get in generic get*_r implementation
 
 Version 2.26
diff --git a/math/math.h b/math/math.h
index e217080..dea8dbe 100644
--- a/math/math.h
+++ b/math/math.h
@@ -442,8 +442,12 @@ enum
 
 /* Return nonzero value if X is positive or negative infinity.  */
 # if __HAVE_DISTINCT_FLOAT128 && !__GNUC_PREREQ (7,0) \
-     && !defined __SUPPORT_SNAN__
-   /* __builtin_isinf_sign is broken for float128 only before GCC 7.0.  */
+     && !defined __SUPPORT_SNAN__ && !defined __cplusplus
+   /* Since __builtin_isinf_sign is broken for float128 before GCC 7.0,
+      use the helper function, __isinff128, with older compilers.  This is
+      only provided for C mode, because in C++ mode, GCC has no support
+      for __builtin_types_compatible_p (and when in C++ mode, this macro is
+      not used anyway, because libstdc++ headers undefine it).  */
 #  define isinf(x) \
     (__builtin_types_compatible_p (__typeof (x), _Float128) \
      ? __isinff128 (x) : __builtin_isinf_sign (x))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog        |   11 +++++++++++
 NEWS             |    1 +
 math/math.h      |    8 ++++++--
 misc/sys/cdefs.h |   19 ++++++++++---------
 4 files changed, 28 insertions(+), 11 deletions(-)


hooks/post-receive
-- 
GNU C Library master sources


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]