From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com [68.232.137.252]) by sourceware.org (Postfix) with ESMTPS id E8CAD3858C27 for ; Wed, 30 Sep 2020 17:16:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org E8CAD3858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=codesourcery.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=joseph_myers@mentor.com IronPort-SDR: rkTVVOW1sVCtfwoEs5JLXErF6NO6sPesaS9i6K+Wai5IUaREHcheeneZYqgb1d/M1YpbWLXQkL yA8rqb9A2SBW6VapkTQtssh5yXxIdVlf7+luyxO2HJHtY1hxXxQvMiloxjCSlHkvXiyJSJFJB1 QrH2c2f/aIW5HXQLCAp5kmZZPz4vuffT37v+6Zjws2R6NLOXTr5PhmbumjUA0heiaJi7CiGpCW wPfj+VEJRc9Z6lUYB/rV6Sd13llTUQFFBTrxagHPiQfbY7sNswKFGPrONGEv8Jbr/uu4b9e9uW Tf0= X-IronPort-AV: E=Sophos;i="5.77,322,1596528000"; d="scan'208";a="53575252" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 30 Sep 2020 09:16:25 -0800 IronPort-SDR: bjA6jjRy40MedrpsUuyiNbDgQCVq4j4EiKg0LiN8Rpb8WGFeKMcz40KD8fYRRYhjffazUEuqT6 3osl3hDFV+ceNE11D+n3OAG3A/13Cd8dsYBbuT/PvhTnj5aRLLuMq+PgPlx0mQE0YWBOmrq5uy IcLBTsq7YHH/5F4GDCcEFsSFaQFLeYe+b58xo9yxU37gE13duBSsqsDS5q6GF4FLWMkh+gwI3o oPPLREIonDrosPMOYLQyNO2/rpuQbIya+eNqzsGVgs5lbhBh+EPPpdw9g4LIfYe+tggDlFyrQH vl8= Date: Wed, 30 Sep 2020 17:16:16 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Alejandro Colomar CC: Dave Martin , "G. Branden Robinson" , , , Subject: Re: [PATCH 1/2] system_data_types.7: Document size_t In-Reply-To: Message-ID: References: <20200918112755.21428-1-colomar.6.4.3@gmail.com> <20200918112755.21428-2-colomar.6.4.3@gmail.com> <20200928134122.GG6642@arm.com> <8ce3d63c-445f-827b-a49a-914e8dd622d4@gmail.com> <20200928135506.2wsf3cwvkkbreqa3@localhost.localdomain> <20200928141524.GH6642@arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) X-Spam-Status: No, score=-3126.8 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Sep 2020 17:16:27 -0000 On Mon, 28 Sep 2020, Alejandro Colomar via Libc-alpha wrote: > > To clarify, does POSIX _guarantee_ that all of those headers define this > > type? (I admit I'm too lazy to search through the POSIX standard for an > > answer to this). > > Yes, POSIX does guarantee that all those headers define the type. For a lot of cases where a header contains a function using a type in its prototype, current POSIX requires that type to be defined in the header, but older POSIX permitted it (by virtue of the *_t reservation) but did not require it unless XSI extensions were enabled. The preferred glibc practice in such cases where older POSIX permitted the definition and included functions using the type is not to make the definition of the type in the header conditional on the POSIX version / XSI extensions, but to enable the definition for all standards that include the relevant function. (This simplifies the headers, and also simplifies the conform/ tests because they then don't need to handle testing for a declaration of a function without being able to write its type in the most straightforward way.) The headers still need to include feature test macro conditionals and special handling where a header is required by some standard to declare a function without defining the corresponding type name. (For example, ISO C does not permit to define va_list, so the header has to use an implementation-namespace name for that type when declaring vprintf.) -- Joseph S. Myers joseph@codesourcery.com