From patchwork Mon Mar 11 14:59:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Zack Weinberg X-Patchwork-Id: 1054506 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-100539-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=panix.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="fe9BOfUu"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44J1W82hYnz9s4V for ; Tue, 12 Mar 2019 02:00:36 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=default; b=tyV VGt86TeqYFBi4TyMm5AsOscBezWVrGRaYk5rq1Ulpbp4OoCaR3YPyFwRQ4xzkl3C cvKA959tgQ9UTdL9rEAp28yg92uzQxNghlhHyxs+s6mIxIOJkcbSOhWMWkoLcxcB HMwkj5oeCrBhTWUyb/Yh+DH0lAEROLbMN6MlVp3w= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:subject:date:message-id:mime-version :content-type:content-transfer-encoding; s=default; bh=VRjIlltxD JmqiF0J+XX8ffXtCK0=; b=fe9BOfUu1mgO3DC7/1JG7R9ATOuzcGGU38ix6oXUr E8nOti6ENMFRqJes2+NF8BQ5PueicjWZFmjpJ9WNgMBUmFL6LqaA1O2Z709WWuIQ 81uswq0cFH++QXWhZcMT4nkhZaENSsCQo7TuEMZ2zJvXGQZBsJ33uIRfHb4fFGZi gE= Received: (qmail 29435 invoked by alias); 11 Mar 2019 14:59:57 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 29303 invoked by uid 89); 11 Mar 2019 14:59:57 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.4 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.1 spammy=nis, resource, separately, resubmitted X-HELO: mailbackend.panix.com From: Zack Weinberg To: libc-alpha@sourceware.org Subject: [PATCH 0/8] sys/types.h cleanup and further typedef obsoletion Date: Mon, 11 Mar 2019 10:59:44 -0400 Message-Id: MIME-Version: 1.0 This patch series removes a fair amount of cruft from sys/types.h and bits/types.h, obsoletes four additional typedefs that should not be used in public interfaces anymore (caddr_t, daddr_t, loff_t, register_t), and restricts sys/types.h’s definition of u_intN_t and register_t to __USE_MISC (i.e. they are no longer present in strict conformance modes). It depends on the “Use a proper C tokenizer to implement the obsolete typedefs test” patch, which has just been resubmitted separately. Unlike that patch, this series is not intended to be appropriate for backport to release branches. Zack Weinberg (8): Move inttypes.h and stdint.h to stdlib. Define register_t using bits/typesizes.h macros. sys/types.h: Don’t define u_intN_t or register_t unless __USE_MISC. Add caddr_t, daddr_t, and loff_t to the set of obsolete typedefs. Simplify definition of __time64_t. Clean up bits/types.h. Create bits/types headers for most remaining __T_defined macros. Don’t conditionalize declarations of ldiv_t, lldiv_t, __gwchar_t. NEWS | 8 + bits/socket.h | 8 +- bits/time64.h | 2 +- bits/typesizes.h | 16 +- dirent/dirent.h | 14 +- elf/dl-map-segments.h | 15 +- elf/dl-minimal.c | 2 +- elf/dl-reloc.c | 4 +- grp/grp.h | 6 +- hurd/Makefile | 2 +- hurd/fd-read.c | 2 +- hurd/fd-write.c | 2 +- hurd/hurd/fd.h | 6 +- include/bits/types/blkcnt64_t.h | 1 + include/bits/types/blkcnt_t.h | 1 + include/bits/types/blksize_t.h | 1 + include/bits/types/caddr_t.h | 1 + include/bits/types/daddr_t.h | 1 + include/bits/types/dev_t.h | 1 + include/bits/types/fsblkcnt64_t.h | 1 + include/bits/types/fsblkcnt_t.h | 1 + include/bits/types/fsfilcnt64_t.h | 1 + include/bits/types/fsfilcnt_t.h | 1 + include/bits/types/fsid_t.h | 1 + include/bits/types/gid_t.h | 1 + include/bits/types/id_t.h | 1 + include/bits/types/ino64_t.h | 1 + include/bits/types/ino_t.h | 1 + include/bits/types/intptr_t.h | 1 + include/bits/types/key_t.h | 1 + include/bits/types/loff_t.h | 1 + include/bits/types/mode_t.h | 1 + include/bits/types/nlink_t.h | 1 + include/bits/types/off64_t.h | 1 + include/bits/types/off_t.h | 1 + include/bits/types/pid_t.h | 1 + include/bits/types/register_t.h | 1 + include/bits/types/socklen_t.h | 1 + include/bits/types/ssize_t.h | 1 + include/bits/types/suseconds_t.h | 1 + include/bits/types/u_int.h | 1 + include/bits/types/u_intN_t.h | 1 + include/bits/types/uid_t.h | 1 + include/bits/types/uint.h | 1 + include/bits/types/useconds_t.h | 1 + include/inttypes.h | 2 +- include/stdint.h | 1 + inet/arpa/inet.h | 7 +- intl/loadmsgcat.c | 7 +- io/fcntl.h | 27 +-- io/sys/stat.h | 66 +---- io/sys/statvfs.h | 21 +- libio/stdio.h | 19 +- locale/loadlocale.c | 11 +- misc/sys/mman.h | 16 +- misc/sys/select.h | 7 +- misc/ustat.c | 8 +- nis/nis_add.c | 4 +- nis/nis_call.c | 10 +- nis/nis_callback.c | 12 +- nis/nis_checkpoint.c | 4 +- nis/nis_findserv.c | 8 +- nis/nis_intern.h | 12 +- nis/nis_lookup.c | 4 +- nis/nis_mkdir.c | 8 +- nis/nis_modify.c | 4 +- nis/nis_ping.c | 4 +- nis/nis_remove.c | 4 +- nis/nis_rmdir.c | 4 +- nis/nis_server.c | 8 +- nis/nis_table.c | 28 +-- nis/nis_util.c | 4 +- nis/nss_nisplus/nisplus-grp.c | 8 +- nis/nss_nisplus/nisplus-pwd.c | 8 +- nis/rpcsvc/nis_callback.h | 2 +- nis/rpcsvc/yp.h | 6 +- nis/ypclnt.c | 42 ++-- posix/Makefile | 37 ++- posix/bits/types.h | 206 ++++++---------- posix/bits/types/blkcnt64_t.h | 9 + posix/bits/types/blkcnt_t.h | 13 + posix/bits/types/blksize_t.h | 9 + posix/bits/types/caddr_t.h | 9 + posix/bits/types/daddr_t.h | 9 + posix/bits/types/dev_t.h | 10 + posix/bits/types/fsblkcnt64_t.h | 9 + posix/bits/types/fsblkcnt_t.h | 13 + posix/bits/types/fsfilcnt64_t.h | 9 + posix/bits/types/fsfilcnt_t.h | 13 + posix/bits/types/fsid_t.h | 9 + posix/bits/types/gid_t.h | 9 + posix/bits/types/id_t.h | 10 + posix/bits/types/ino64_t.h | 9 + posix/bits/types/ino_t.h | 13 + posix/bits/types/intptr_t.h | 10 + posix/bits/types/key_t.h | 9 + posix/bits/types/loff_t.h | 9 + posix/bits/types/mode_t.h | 9 + posix/bits/types/nlink_t.h | 9 + posix/bits/types/off64_t.h | 9 + posix/bits/types/off_t.h | 13 + posix/bits/types/pid_t.h | 9 + posix/bits/types/register_t.h | 9 + posix/bits/types/socklen_t.h | 9 + posix/bits/types/ssize_t.h | 9 + posix/bits/types/suseconds_t.h | 9 + posix/bits/types/u_int.h | 15 ++ posix/bits/types/u_intN_t.h | 17 ++ posix/bits/types/uid_t.h | 9 + posix/bits/types/uint.h | 10 + posix/bits/types/useconds_t.h | 9 + posix/sched.h | 6 +- posix/sys/types.h | 227 ++++-------------- posix/sys/wait.h | 11 +- posix/unistd.h | 56 +---- pwd/pwd.h | 11 +- resource/sys/resource.h | 6 +- scripts/check-obsolete-constructs.py | 149 ++++++++---- signal/signal.h | 12 +- {sysdeps/generic => stdlib}/inttypes.h | 15 +- stdlib/monetary.h | 7 +- {sysdeps/generic => stdlib}/stdint.h | 16 +- stdlib/stdlib.h | 6 +- streams/stropts.h | 12 +- sunrpc/auth_des.c | 2 +- sunrpc/auth_unix.c | 4 +- sunrpc/authdes_prot.c | 10 +- sunrpc/authuxprot.c | 2 +- sunrpc/clnt_raw.c | 12 +- sunrpc/clnt_tcp.c | 28 +-- sunrpc/clnt_udp.c | 22 +- sunrpc/clnt_unix.c | 26 +- sunrpc/key_call.c | 2 +- sunrpc/pm_getmaps.c | 2 +- sunrpc/pm_getport.c | 4 +- sunrpc/pmap_clnt.c | 4 +- sunrpc/pmap_prot2.c | 2 +- sunrpc/pmap_rmt.c | 16 +- sunrpc/proto.h | 2 +- sunrpc/rpc/auth.h | 4 +- sunrpc/rpc/clnt.h | 16 +- sunrpc/rpc/pmap_clnt.h | 12 +- sunrpc/rpc/pmap_rmt.h | 4 +- sunrpc/rpc/rpc_msg.h | 2 +- sunrpc/rpc/svc.h | 14 +- sunrpc/rpc/types.h | 44 +--- sunrpc/rpc/xdr.h | 22 +- sunrpc/rpc_clntout.c | 8 +- sunrpc/rpc_cmsg.c | 12 +- sunrpc/rpc_hout.c | 2 +- sunrpc/rpc_prot.c | 4 +- sunrpc/rpc_sample.c | 4 +- sunrpc/rpc_svcout.c | 6 +- sunrpc/svc.c | 2 +- sunrpc/svc_authux.c | 2 +- sunrpc/svc_raw.c | 8 +- sunrpc/svc_tcp.c | 24 +- sunrpc/svc_udp.c | 14 +- sunrpc/svc_unix.c | 28 +-- sunrpc/xdr.c | 4 +- sunrpc/xdr_array.c | 4 +- sunrpc/xdr_mem.c | 12 +- sunrpc/xdr_rec.c | 46 ++-- sunrpc/xdr_ref.c | 6 +- sunrpc/xdr_sizeof.c | 8 +- sunrpc/xdr_stdio.c | 14 +- support/xunistd.h | 4 +- sysdeps/gnu/net/if.h | 4 +- sysdeps/gnu/sys/mtio.h | 4 +- sysdeps/gnu/utmpx.h | 5 +- sysdeps/mach/hurd/bits/socket.h | 8 +- sysdeps/mach/hurd/bits/typesizes.h | 16 +- .../unix/sysv/linux/alpha/bits/typesizes.h | 2 +- sysdeps/unix/sysv/linux/bits/socket.h | 7 +- .../unix/sysv/linux/generic/bits/typesizes.h | 16 +- .../sysv/linux/generic/wordsize-32/overflow.h | 2 +- sysdeps/unix/sysv/linux/lseek.c | 4 +- sysdeps/unix/sysv/linux/lseek64.c | 2 +- sysdeps/unix/sysv/linux/mips/bits/typesizes.h | 88 +++++++ sysdeps/unix/sysv/linux/s390/bits/typesizes.h | 16 +- .../unix/sysv/linux/sparc/bits/typesizes.h | 16 +- sysdeps/unix/sysv/linux/splice.c | 2 +- sysdeps/unix/sysv/linux/sys/quota.h | 4 +- sysdeps/unix/sysv/linux/test-errno-linux.c | 2 +- sysdeps/unix/sysv/linux/ustat.c | 9 +- sysdeps/unix/sysv/linux/x86/bits/typesizes.h | 21 +- sysvipc/sys/ipc.h | 24 +- sysvipc/sys/msg.h | 12 +- sysvipc/sys/shm.h | 9 +- termios/termios.h | 8 +- time/sys/time.h | 6 +- time/time.h | 5 +- 192 files changed, 1209 insertions(+), 1149 deletions(-) create mode 100644 include/bits/types/blkcnt64_t.h create mode 100644 include/bits/types/blkcnt_t.h create mode 100644 include/bits/types/blksize_t.h create mode 100644 include/bits/types/caddr_t.h create mode 100644 include/bits/types/daddr_t.h create mode 100644 include/bits/types/dev_t.h create mode 100644 include/bits/types/fsblkcnt64_t.h create mode 100644 include/bits/types/fsblkcnt_t.h create mode 100644 include/bits/types/fsfilcnt64_t.h create mode 100644 include/bits/types/fsfilcnt_t.h create mode 100644 include/bits/types/fsid_t.h create mode 100644 include/bits/types/gid_t.h create mode 100644 include/bits/types/id_t.h create mode 100644 include/bits/types/ino64_t.h create mode 100644 include/bits/types/ino_t.h create mode 100644 include/bits/types/intptr_t.h create mode 100644 include/bits/types/key_t.h create mode 100644 include/bits/types/loff_t.h create mode 100644 include/bits/types/mode_t.h create mode 100644 include/bits/types/nlink_t.h create mode 100644 include/bits/types/off64_t.h create mode 100644 include/bits/types/off_t.h create mode 100644 include/bits/types/pid_t.h create mode 100644 include/bits/types/register_t.h create mode 100644 include/bits/types/socklen_t.h create mode 100644 include/bits/types/ssize_t.h create mode 100644 include/bits/types/suseconds_t.h create mode 100644 include/bits/types/u_int.h create mode 100644 include/bits/types/u_intN_t.h create mode 100644 include/bits/types/uid_t.h create mode 100644 include/bits/types/uint.h create mode 100644 include/bits/types/useconds_t.h create mode 100644 include/stdint.h create mode 100644 posix/bits/types/blkcnt64_t.h create mode 100644 posix/bits/types/blkcnt_t.h create mode 100644 posix/bits/types/blksize_t.h create mode 100644 posix/bits/types/caddr_t.h create mode 100644 posix/bits/types/daddr_t.h create mode 100644 posix/bits/types/dev_t.h create mode 100644 posix/bits/types/fsblkcnt64_t.h create mode 100644 posix/bits/types/fsblkcnt_t.h create mode 100644 posix/bits/types/fsfilcnt64_t.h create mode 100644 posix/bits/types/fsfilcnt_t.h create mode 100644 posix/bits/types/fsid_t.h create mode 100644 posix/bits/types/gid_t.h create mode 100644 posix/bits/types/id_t.h create mode 100644 posix/bits/types/ino64_t.h create mode 100644 posix/bits/types/ino_t.h create mode 100644 posix/bits/types/intptr_t.h create mode 100644 posix/bits/types/key_t.h create mode 100644 posix/bits/types/loff_t.h create mode 100644 posix/bits/types/mode_t.h create mode 100644 posix/bits/types/nlink_t.h create mode 100644 posix/bits/types/off64_t.h create mode 100644 posix/bits/types/off_t.h create mode 100644 posix/bits/types/pid_t.h create mode 100644 posix/bits/types/register_t.h create mode 100644 posix/bits/types/socklen_t.h create mode 100644 posix/bits/types/ssize_t.h create mode 100644 posix/bits/types/suseconds_t.h create mode 100644 posix/bits/types/u_int.h create mode 100644 posix/bits/types/u_intN_t.h create mode 100644 posix/bits/types/uid_t.h create mode 100644 posix/bits/types/uint.h create mode 100644 posix/bits/types/useconds_t.h rename {sysdeps/generic => stdlib}/inttypes.h (98%) rename {sysdeps/generic => stdlib}/stdint.h (96%) create mode 100644 sysdeps/unix/sysv/linux/mips/bits/typesizes.h