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

[PATCH 0/4] Installed-header compilation hygiene, BZ#20366


Some of glibc's installed headers throw compilation errors if used in
strict standards compliance modes (e.g. -std=c89 with no
-D_ANYTHING_SOURCE), or if included without dependencies.  I have a
program that tests the installed headers for this class of problems,
among other things, and I'd like to propose a batch of corrections for
2.24.  I believe all of these qualify as bugfixes and should be
low-risk.

The problems fixed are:

 * Use of the "legacy" BSD unsigned integer typedefs (u_intN_t, u_char,
   u_int, u_short, u_long) in code not guarded by __USE_MISC
   (sys/gmon.h, fts.h, resolv.h, many others)

 * Use of foo_t instead of __foo_t, where foo_t is only defined by
   <sys/types.h> under __USE_MISC or __USE_XOPEN2K8 or like that.
   (sys/quota.h, sys/timerfd.h)

 * Unconditional use of 'struct ifreq', 'struct osockaddr', and
   'stack_t', which are conditionally defined, and no alternative is
   available (net/if_ppp.h, protocols/talkd.h, sys/ucontext.h
   respectively)

 * Use of BYTE_ORDER, BIG_ENDIAN, etc instead of __BYTE_ORDER,
   __BIG_ENDIAN, etc.  (arpa/nameser_compat.h)

 * No-longer-necessary #warnings (sys/ipc.h)

 * Missing #includes (rpcsvc/nislib.h, netrose/rose.h)

 * Accidentally installed internal-use-only headers (grp-merge.h)

This is BZ#20366.

zw
-- 

Zack Weinberg (4):
  Installed-header compilation hygiene, 1/4 (easy changes).
  Installed-header compilation hygiene, 2/4 (struct osockaddr).
  Installed-header compilation hygiene, 3/4 (struct ifreq).
  Installed-header compilation hygiene, 4/4 (stack_t).

 bits/sigcontext.h                               |   7 +-
 bits/sigstack.h                                 |   7 +-
 gmon/sys/gmon.h                                 |  30 ++---
 grp/Makefile                                    |   2 +-
 inet/protocols/routed.h                         |   6 +-
 inet/protocols/talkd.h                          |  33 +++--
 inet/protocols/timed.h                          |   6 +-
 io/fts.h                                        |  20 ++--
 nis/rpcsvc/nislib.h                             |   2 +-
 resolv/arpa/nameser.h                           | 153 +++++++++++++-----------
 resolv/arpa/nameser_compat.h                    |   4 +-
 resolv/resolv.h                                 | 125 ++++++++++---------
 socket/sys/socket.h                             |   6 +-
 sunrpc/rpc/rpc_des.h                            |   8 +-
 sysdeps/arm/sys/ucontext.h                      |   6 +
 sysdeps/generic/sys/ucontext.h                  |   6 +-
 sysdeps/i386/sys/ucontext.h                     |   6 +
 sysdeps/m68k/sys/ucontext.h                     |   6 +
 sysdeps/mach/hurd/i386/bits/sigcontext.h        |   7 +-
 sysdeps/mach/hurd/net/if_ppp.h                  |   3 +
 sysdeps/mips/sys/ucontext.h                     |   9 +-
 sysdeps/unix/sysv/linux/aarch64/bits/sigstack.h |  25 ++--
 sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h  |   9 +-
 sysdeps/unix/sysv/linux/alpha/bits/sigstack.h   |  25 ++--
 sysdeps/unix/sysv/linux/alpha/sys/ucontext.h    |   3 +
 sysdeps/unix/sysv/linux/arm/sys/ucontext.h      |   6 +-
 sysdeps/unix/sysv/linux/bits/sigcontext.h       |   5 +
 sysdeps/unix/sysv/linux/bits/sigstack.h         |  25 ++--
 sysdeps/unix/sysv/linux/hppa/sys/ucontext.h     |   5 +-
 sysdeps/unix/sysv/linux/ia64/bits/sigcontext.h  |   6 +-
 sysdeps/unix/sysv/linux/ia64/bits/sigstack.h    |  29 ++---
 sysdeps/unix/sysv/linux/ia64/sys/ucontext.h     |   4 +
 sysdeps/unix/sysv/linux/m68k/sys/ucontext.h     |   6 +
 sysdeps/unix/sysv/linux/mips/bits/sigstack.h    |  25 ++--
 sysdeps/unix/sysv/linux/mips/sys/ucontext.h     |   9 +-
 sysdeps/unix/sysv/linux/net/if_ppp.h            |   3 +
 sysdeps/unix/sysv/linux/netrose/rose.h          |   3 +
 sysdeps/unix/sysv/linux/nios2/sys/ucontext.h    |   6 +
 sysdeps/unix/sysv/linux/powerpc/bits/sigstack.h |  25 ++--
 sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h  |   6 +-
 sysdeps/unix/sysv/linux/s390/sys/ucontext.h     |  10 +-
 sysdeps/unix/sysv/linux/sh/sys/ucontext.h       |   5 +-
 sysdeps/unix/sysv/linux/sparc/bits/sigcontext.h |   5 +
 sysdeps/unix/sysv/linux/sparc/bits/sigstack.h   |  25 ++--
 sysdeps/unix/sysv/linux/sparc/sys/ucontext.h    |   7 ++
 sysdeps/unix/sysv/linux/sys/quota.h             |   2 +-
 sysdeps/unix/sysv/linux/sys/timerfd.h           |   2 +-
 sysdeps/unix/sysv/linux/tile/sys/ucontext.h     |   6 +-
 sysdeps/unix/sysv/linux/x86/sys/ucontext.h      |   6 +-
 sysvipc/sys/ipc.h                               |   4 -
 50 files changed, 458 insertions(+), 291 deletions(-)


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