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 network/21455] Network headers stdint.h namespace


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

--- 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  176804300be88f9ceaef7d7a2304b1ed48f0f356 (commit)
      from  593bf7189a82b9b2874d41c71cb2109482a9f201 (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=176804300be88f9ceaef7d7a2304b1ed48f0f356

commit 176804300be88f9ceaef7d7a2304b1ed48f0f356
Author: Joseph Myers <joseph@codesourcery.com>
Date:   Thu May 4 20:36:42 2017 +0000

    Fix network headers stdint.h namespace (bug 21455).

    conform/ namespace tests of arpa/inet.h, netdb.h and netinet/in.h fail
    for UNIX98 and XPG42 because of inclusion of stdint.h, which defines
    macros not permitted in those headers for those standards.  UNIX98
    allows them to include inttypes.h, but (predating C99) has restricted
    inttypes.h contents (not yet tested in the conform/ tests) not
    including those macros; XPG4.2 has no such permission and no
    inttypes.h / stdint.h at all.

    This patch rearranges the headers to avoid this issue.  intN_t
    definitions move to bits/stdint-intn.h, and uintN_t definitions to
    bits/stdint-uintn.h.  (These are not bits/types/ headers because they
    each define four types.  They are separate rather than just a single
    header because sys/types.h defines intN_t but u_intN_t rather than
    uintN_t - and while sys/types.h could define uintN_t because of the
    POSIX reservation of *_t, existing practice there is largely to
    condition types on appropriate feature test macros, and indeed there
    is at least one open bug report (14553) about a type that's not
    so-conditioned, so maybe types there should actually have conditions
    added where appropriate.)  The affected network headers are then made
    to include bits/stdint-uintn.h instead of stdint.h.  This allows six
    XFAILs to be removed.

    This doesn't do anything about inttypes.h defining more than it should
    for UNIX98, but we don't have conformtest expectations for that case
    at present (and my inclination is that a fix for that should be as
    local as possible - affecting only inttypes.h, not stdint.h, only for
    the case of __USE_UNIX98 && !__USE_ISOC99).

    Tested for x86_64.

        [BZ #21455]
        * bits/stdint-intn.h: New file.
        * bits/stdint-uintn.h: Likewise.
        * stdlib/Makefile (headers): Add bits/stdint-intn.h and
        bits/stdint-uintn.h.
        * inet/netinet/in.h: Include <bits/stdint-uintn.h> instead of
        <stdint.h>.
        * posix/sys/types.h: Include <bits/stdint-intn.h>.
        (__int8_t_defined): Do not define here.
        (int8_t): Likewise.
        (int16_t): Likewise.
        (int32_t): Likewise.
        (int64_t): Likewise.
        [__GNUC_PREREQ (2, 7)] (__intN_t): Likewise.
        * resolv/netdb.h: Include <bits/stdint-uintn.h> instead of
        <stdint.h>.
        * include/netdb.h [_ISOMAC]: Do not include <stdint.h>.
        * sysdeps/generic/stdint.h: Include <bits/stdint-intn.h> and
        <bits/stdint-uintn.h>.
        (int8_t): Do not define here.
        (int16_t): Likewise.
        (int32_t): Likewise.
        (int64_t): Likewise.
        (uint8_t): Likewise.
        (uint16_t): Likewise.
        (uint32_t): Likewise.
        (uint64_t): Likewise.
        * conform/Makefile (test-xfail-XPG42/arpa/inet.h/conform): Remove
        variable.
        (test-xfail-XPG42/netdb.h/conform): Likewise.
        (test-xfail-XPG42/netinet/in.h/conform): Likewise.
        (test-xfail-UNIX98/arpa/inet.h/conform): Likewise.
        (test-xfail-UNIX98/netdb.h/conform): Likewise.
        (test-xfail-UNIX98/netinet/in.h/conform): Likewise.

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

Summary of changes:
 ChangeLog                               |   37 +++++++++++++++++++++++++++++++
 support/xclose.c => bits/stdint-intn.h  |   21 +++++++++--------
 support/xclose.c => bits/stdint-uintn.h |   21 +++++++++--------
 conform/Makefile                        |    6 -----
 include/netdb.h                         |    2 +-
 inet/netinet/in.h                       |    2 +-
 posix/sys/types.h                       |   27 ++--------------------
 resolv/netdb.h                          |    2 +-
 stdlib/Makefile                         |    3 +-
 sysdeps/generic/stdint.h                |   28 +---------------------
 10 files changed, 69 insertions(+), 80 deletions(-)
 copy support/xclose.c => bits/stdint-intn.h (76%)
 copy support/xclose.c => bits/stdint-uintn.h (75%)

-- 
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]