From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 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 dcvr.yhbt.net (Postfix) with ESMTPS id 584591F45F for ; Thu, 9 May 2019 08:34:20 +0000 (UTC) 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:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; q=dns; s=default; b=Tu5C1 0CXUwFJGrYjXvky2bFZHqacfIJ5fYLYaFD0ZXufQKJCRgKUeXOcG2dvg8R5Bepkj /OKNP2oo7Sua/kKMmWm/n2KVIFi6rae1O2Ik3iEqLVtxVNdXCzZL3BJhUgG67Zek ZCGVqJUgSm/rfhPOw+3oxZxAYa0MQykDwObhLA= 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:cc:subject:references:date:in-reply-to :message-id:mime-version:content-type; s=default; bh=1gpZZBNTPZG 8DtmeR3+mSKGEz8o=; b=mBLyG+IH9Hy72oS4d0OICywu+zSA2F0Frqyf2FtnSE3 GJvQGB+Xs4qjSTp1KoF30S0vbKPk3fDeLKprbmunh24a2ITiI+HIPh3hGN7aygGo VfarvKmc6irML/nLeQfPX2nR8rXzqjRxnsWqBVBiibDkAvvsHcN/RbvfKynfSuTk = Received: (qmail 69547 invoked by alias); 9 May 2019 08:34:18 -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 Received: (qmail 69538 invoked by uid 89); 9 May 2019 08:34:17 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mx1.redhat.com From: Florian Weimer To: Zack Weinberg Cc: libc-alpha@sourceware.org Subject: Re: [PATCH 3/8] sys/types.h: =?utf-8?Q?Don=E2=80=99t?= define u_intN_t or register_t unless __USE_MISC. References: Date: Thu, 09 May 2019 10:34:01 +0200 In-Reply-To: (Zack Weinberg's message of "Mon, 11 Mar 2019 10:59:47 -0400") Message-ID: <878svgt4au.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain * Zack Weinberg: > +* The typedefs u_int8_t, u_int16_t, u_int32_t, u_int64_t, and register_t > + are no longer defined by in strict conformance modes. > + These types were historically provided by on BSD systems, > + but are not part of the POSIX specification for that header. Applications > + requiring fixed-width unsigned integer types should use the similarly > + named uint8_t, uint16_t, etc. from . There is no standardized > + replacement for register_t. The challenge with register_t is that it's long long on x32 and MIPS64 with -mabi=n32. And ideally, it would be the return type of the syscall function (which is long int by incorrect tradition). > diff --git a/posix/sys/types.h b/posix/sys/types.h > index 1bbd896ad4..7327904346 100644 > --- a/posix/sys/types.h > +++ b/posix/sys/types.h > @@ -143,18 +143,20 @@ typedef __suseconds_t suseconds_t; > #define __need_size_t > #include > > +/* POSIX does not require intN_t to be defined in this header, so > + technically this ought to be under __USE_MISC, but it doesn't > + forbid them to be defined here either, and much existing code > + expects them to be defined here. */ > +#include > + > #ifdef __USE_MISC > /* Old compatibility names for C types. */ > typedef unsigned long int ulong; > typedef unsigned short int ushort; > typedef unsigned int uint; > -#endif > > -/* These size-specific names are used by some of the inet code. */ > - > -#include > - > -/* These were defined by ISO C without the first `_'. */ > +/* These size-specific names are used by some of the inet code. > + They were defined by ISO C without the first `_'. */ > typedef __uint8_t u_int8_t; > typedef __uint16_t u_int16_t; > typedef __uint32_t u_int32_t; I think the comment refers to the same types as the comment above the inclusion of . Maybe that could be made more clear to the casual reader? Rest of the patch looks fine to me. Thanks, Florian