This is the mail archive of the 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 libc/21944] sigval namespace

--- Comment #1 from cvs-commit at gcc dot <cvs-commit at gcc dot> ---
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  67f0aff0c63e5deaade7f6cc7758f5cb63344fb8 (commit)
      from  87e7bf4d36af0a4622dc2687730f26d7d53003fe (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 -----------------------------------------------------------------;h=67f0aff0c63e5deaade7f6cc7758f5cb63344fb8

commit 67f0aff0c63e5deaade7f6cc7758f5cb63344fb8
Author: Joseph Myers <>
Date:   Wed Aug 16 20:33:59 2017 +0000

    Fix sigval namespace (bug 21944).

    XPG4.2 defines the siginfo_t type, but not union sigval or its
    contents (which were added in the 1993 edition of POSIX.1), resulting
    in namespace violations for sigval, sival_int and sival_ptr for
    signal.h and sys/wait.h for that standard because those headers
    incorrectly expose those names in that case.

    This patch fixes this problem.  The public type in this case is union
    sigval, but various places in the headers use the sigval_t name for
    it; direct uses of union sigval are already properly guarded or in
    headers not in XPG4.2.  Now, sigval_t, although not a standard name,
    does seem to be widely used outside glibc.  The approach taken by this
    patch is to make installed headers use the name __sigval_t instead.
    __sigval_t is then defined to either union sigval or union __sigval
    (where union __sigval has __-prefixed member names as well), depending
    on whether there are any namespace issues with the union sigval name
    and its members.  In the case where union __sigval is used, sigval_t
    is not defined at all, to avoid the problem of sigval_t having a C++
    mangled name that depends on feature test macros.  sigval_t is still
    defined by signal.h if __USE_MISC (reflecting the nonstandard nature
    of that name).

    Tested for x86_64.

        [BZ #21944]
        * signal/bits/types/__sigval_t.h: New file.
        * signal/Makefile (headers): Add bits/types/__sigval_t.h.
        * signal/bits/types/sigval_t.h: Include <bits/types/__sigval_t.h>
        and define sigval_t using __sigval_t.
        * include/bits/types/__sigval_t.h: New file.
        * bits/types/sigevent_t.h: Include <bits/types/__sigval_t.h>
        instead of <bits/types/__sigval_t.h>.
        (struct sigevent): Use __sigval_t instead of sigval_t.
        * bits/types/siginfo_t.h: Include <bits/types/__sigval_t.h>
        instead of <bits/types/__sigval_t.h>.
        (siginfo_t): Use __sigval_t instead of sigval_t.
        * sysdeps/unix/sysv/linux/bits/types/sigevent_t.h: Include
        <bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>.
        (struct sigevent): Use __sigval_t instead of sigval_t.
        * sysdeps/unix/sysv/linux/bits/types/siginfo_t.h: Include
        <bits/types/__sigval_t.h> instead of <bits/types/__sigval_t.h>.
        (siginfo_t): Use __sigval_t instead of sigval_t.
        * signal/signal.h [__USE_MISC]: Include <bits/types/sigval_t.h>.


Summary of changes:
 ChangeLog                                       |   22 ++++++++++++++++
 bits/types/sigevent_t.h                         |    6 ++--
 bits/types/siginfo_t.h                          |    4 +-
 include/bits/types/__sigval_t.h                 |    1 +
 signal/Makefile                                 |    3 +-
 math/s_fma.c => signal/bits/types/__sigval_t.h  |   31 ++++++++++++++---------
 signal/bits/types/sigval_t.h                    |   21 +++++++++------
 signal/signal.h                                 |    4 +++
 sysdeps/unix/sysv/linux/bits/types/sigevent_t.h |    6 ++--
 sysdeps/unix/sysv/linux/bits/types/siginfo_t.h  |    6 ++--
 10 files changed, 72 insertions(+), 32 deletions(-)
 create mode 100644 include/bits/types/__sigval_t.h
 copy math/s_fma.c => signal/bits/types/__sigval_t.h (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]