]> git.ipfire.org Git - thirdparty/glibc.git/commit
sys/types.h: Don’t define u_intN_t or register_t unless __USE_MISC.
authorZack Weinberg <zackw@panix.com>
Tue, 19 Feb 2019 02:00:34 +0000 (21:00 -0500)
committerZack Weinberg <zackw@panix.com>
Wed, 8 Jan 2020 17:52:50 +0000 (12:52 -0500)
commit40782c2685760fc7fe9d82738e3091bfa5216c1c
treecae674713f38b587349fe832822076bda58afe71
parent9d8ecbbf117a1f3ddeb6b80a4e242d43a1f6d390
sys/types.h: Don’t define u_intN_t or register_t unless __USE_MISC.

sys/types.h unconditionally defines u_int8_t, u_int16_t, u_int32_t,
u_int64_t, and register_t.  These are not part of any standard.  The
u_intXX_t types are superseded by C99’s uintXX_t types (defined in
stdint.h).  I’m not aware of a standardized exact equivalent of
register_t, but also I’ve never seen anyone use it for anything.
I could be persuaded to leave that one alone.

sys/types.h also unconditionally defines int8_t, int16_t, int32_t, and
int64_t, which are the same as the C99 exact-width signed types in
stdint.h.  POSIX doesn’t require these to appear in sys/types.h, so in
principle they ought to be brought under __USE_MISC also.  But, when I
tried that it broke about two dozen files just in our own source tree,
and POSIX doesn’t *forbid* sys/types.h to define these types, so I
think we should leave them alone.

* posix/sys/types.h (u_int8_t, u_int16_t, u_int32_t, u_int64_t)
        (register_t): Move under #ifdef __USE_MISC.
        Consolidate adjacent #ifdef __USE_MISC blocks.
        * scripts/check_obsolete_constructs.py: Add register_t to the
        set of obsolete typedefs that our headers should not use
        (but sys/types.h may still define).
NEWS
posix/sys/types.h
scripts/check-obsolete-constructs.py