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.9000-822-g9596fc6


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  9596fc69b188b5a190ed41ac92c0330efef1fdaa (commit)
      from  46453c3cdad9575f264a49f003a2a9f2847708c8 (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=9596fc69b188b5a190ed41ac92c0330efef1fdaa

commit 9596fc69b188b5a190ed41ac92c0330efef1fdaa
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Fri Nov 24 22:03:35 2017 +0000

    Make min_of_type_ macros function-like.
    
    math_private.h uses __MATH_TG in defining the min_of_type macro used
    within libm, with min_of_type_<suffix> macros for each type.  This
    runs into problems with __MATH_TG expansions used with additional
    _FloatN and _FloatNx type support, because those can end up
    macro-expanding the FUNC argument to __MATH_TG before it gets
    concatenated with a suffix - meaning that min_of_type_ can't
    simultaneously be the macro name for double, and a prefix to other
    macro names, since the latter case requires such premature macro
    expansion not to occur.  (This is not a problem for the uses of
    __MATH_TG in installed headers because FUNC there is a function name
    in the implementation namespace, and the suffixes themselves don't get
    macro-expanded.)
    
    This patch fixes the problem by making min_of_type_<suffix> macros
    function-like, so no macro expansion occurs when min_of_type_ is
    expanded on its own as a macro argument, only later when followed by
    () after expansion.
    
    Tested for x86_64, including in conjunction with _Float64x support
    patches.
    
    	* sysdeps/generic/math_private.h (min_of_type_f): Make into a
    	function-like macro.
    	(min_of_type_): Likewise.
    	(min_of_type_l): Likewise.
    	(min_of_type_f128): Likewise.
    	(min_of_type): Pass () as last argument of __MATH_TG.

diff --git a/ChangeLog b/ChangeLog
index be9ed44..3da496d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 2017-11-24  Joseph Myers  <joseph@codesourcery.com>
 
+	* sysdeps/generic/math_private.h (min_of_type_f): Make into a
+	function-like macro.
+	(min_of_type_): Likewise.
+	(min_of_type_l): Likewise.
+	(min_of_type_f128): Likewise.
+	(min_of_type): Pass () as last argument of __MATH_TG.
+
 	* stdlib/tst-strtod-round-skeleton.c
 	(__STDC_WANT_IEC_60559_TYPES_EXT__): Define before including
 	headers.
diff --git a/sysdeps/generic/math_private.h b/sysdeps/generic/math_private.h
index 80c7c92..f29898c 100644
--- a/sysdeps/generic/math_private.h
+++ b/sysdeps/generic/math_private.h
@@ -298,12 +298,15 @@ extern void __docos (double __x, double __dx, double __v[]);
 
 #define fabs_tg(x) __MATH_TG ((x), (__typeof (x)) __builtin_fabs, (x))
 
-#define min_of_type_f FLT_MIN
-#define min_of_type_ DBL_MIN
-#define min_of_type_l LDBL_MIN
-#define min_of_type_f128 FLT128_MIN
-
-#define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, )
+/* These must be function-like macros because some __MATH_TG
+   implementations macro-expand the function-name argument before
+   concatenating a suffix to it.  */
+#define min_of_type_f() FLT_MIN
+#define min_of_type_() DBL_MIN
+#define min_of_type_l() LDBL_MIN
+#define min_of_type_f128() FLT128_MIN
+
+#define min_of_type(x) __MATH_TG ((x), (__typeof (x)) min_of_type_, ())
 
 /* If X (which is not a NaN) is subnormal, force an underflow
    exception.  */

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

Summary of changes:
 ChangeLog                      |    7 +++++++
 sysdeps/generic/math_private.h |   15 +++++++++------
 2 files changed, 16 insertions(+), 6 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]