This is the mail archive of the glibc-bugs@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]

[Bug math/22028] bits/math-finite.h _MSUF_ expansion namespace


https://sourceware.org/bugzilla/show_bug.cgi?id=22028

--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
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  7daada0319613fec8c2a10b28eed911f4d359a6a (commit)
      from  1cf1232cd4721dc155a5cf7d571e5b1dae506430 (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 -----------------------------------------------------------------
https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=7daada0319613fec8c2a10b28eed911f4d359a6a

commit 7daada0319613fec8c2a10b28eed911f4d359a6a
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Tue Aug 29 14:15:37 2017 +0000

    Fix bits/math-finite.h _MSUF_ expansion namespace (bug 22028).

    The current bits/math-finite.h approach to defining functions for
    different types, involving math.h defining _MSUF_ and _MSUFTO_ for the
    function suffixes involved, is not namespace-clean if one of those
    suffixes (f, l, f128) is defined as a macro by the user before math.h
    is included; too many levels of macro expansion occur.  Instead, those
    suffixes should appear directly in the expansion of the macro using ##
    so they don't get expanded even if defined as macros by the user (that
    is, math.h should be defining __REDIRFROM_X and __REDIRTO_X directly
    to use those suffixes rather than suffixes being passed as an argument
    by macro callers).  This patch makes that change.

    Tested for x86_64.

        [BZ #22028]
        * math/math.h [__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0]
        (_MSUF_): Remove macro.
        [__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0] (_MSUFTO_):
        Likewise.
        [__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0]
        (__REDIRFROM_X): New macro.
        [__FINITE_MATH_ONLY__ && __FINITE_MATH_ONLY__ > 0] (__REDIRTO_X):
        Likewise.
        * math/bits/math-finite.h (__REDIRFROM_X): Remove macro.
        (__REDIRTO_X): Likewise.
        (__MATH_REDIRCALL): Do not pass _MSUF_ or _MSUFTO_ macro
        arguments.
        (__MATH_REDIRCALL_2): Likewise.
        (__MATH_REDIRCALL_INTERNAL): Likewise.
        (__REDIRFROM (lgamma, , _MSUF_)): Likewise.
        (__REDIRFROM (gamma, , _MSUF_)): Likweise.
        (__REDIRFROM (__gamma, _r_finite, _MSUF_)): Likewise.
        (__REDIRFROM (tgamma, , _MSUF_)): Likewise.
        * math/test-finite-macros.c: New file.
        * math/Makefile (tests): Add test-finite-macros.
        (CFLAGS-test-finite-macros.c): New variable.

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

Summary of changes:
 ChangeLog                                      |   25 +++++++++++++
 math/Makefile                                  |    4 ++-
 math/bits/math-finite.h                        |   34 +++++++----------
 math/math.h                                    |   46 ++++++++++++++---------
 debug/tst-ssp-1.c => math/test-finite-macros.c |   28 +++++----------
 5 files changed, 79 insertions(+), 58 deletions(-)
 copy debug/tst-ssp-1.c => math/test-finite-macros.c (70%)

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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