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 master updated. glibc-2.26-130-g6913ad6


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  6913ad65e00bb32417ad39c41d292b976171e27e (commit)
       via  47a67213a9f51c5f8816d240500b10db605d8b77 (commit)
      from  c647fb885cb678471f6b6a66f394b4ca5515a016 (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=6913ad65e00bb32417ad39c41d292b976171e27e

commit 6913ad65e00bb32417ad39c41d292b976171e27e
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.

diff --git a/ChangeLog b/ChangeLog
index 2050a1c..7ba3baf 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 b3e7f3b..cfd39d5 100644
--- a/misc/sys/cdefs.h
+++ b/misc/sys/cdefs.h
@@ -463,17 +463,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=47a67213a9f51c5f8816d240500b10db605d8b77

commit 47a67213a9f51c5f8816d240500b10db605d8b77
Author: Gabriel F. T. Gomes <gftg@linux.vnet.ibm.com>
Date:   Fri Aug 11 14:29:06 2017 -0300

    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.

diff --git a/ChangeLog b/ChangeLog
index 4b99033..2050a1c 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-18  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
 	* sysdeps/generic/not-cancel.h (write_not_cancel): Remove macro.
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 +++++++++++
 math/math.h      |    8 ++++++--
 misc/sys/cdefs.h |   19 ++++++++++---------
 3 files changed, 27 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]