From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com [68.232.137.180]) by sourceware.org (Postfix) with ESMTPS id 0643B3857C7E for ; Wed, 30 Sep 2020 15:50:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0643B3857C7E 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: mD1KiFT6BmytNL/JsqS4t+ke/Qgf5smlI9WwQ4K0rsAK16GlpvEYbVKeLbv6WtIsfV7r3buSvx iGhGMpS21HPBn2d5UYCVr9JybY6UzbDMC5TxzHQLJWGoCSw7VYWYKnPtEa1tkJaeoRAsZ/OZz1 5hQe7VQbRxy/2bIrFetQB3sM1mEe/0jNgm+/39Dtcvk2H/zvoshPi+k2WzRv4buiaZdcwViRPK iq5qy2xAJeGtKge0fudSsU5/WKJQsXZdt5FwOCX/9LlBpNhxUEw4ucJOm8zVCXsiFq0hbcsef4 8C8= X-IronPort-AV: E=Sophos;i="5.77,322,1596528000"; d="scan'208";a="53421273" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 30 Sep 2020 07:50:46 -0800 IronPort-SDR: Zu7dNyjg89mmL3Dk3qOvCUuKRszIbJWNmplu4gMtzDyXdf9M2Gnc694HEsAQyhkscO8Y1RJhVV nt0871hpY00u9mYolIc3dG2luYSaOTSn4BtXh2PkxOpuV3Q3fpJZUpZiygV3uCqPCigM+aEtD1 WJe0/3HDBgYPH2wPOroIjCihAVDhIALC/MSMhOpJENpTOGuWizVOXmLMg0rNiX5sT6aoD1qObm L2fcnT4gpLKPWQ3Gk3Zlqbt+I6wQZUggGbdsd6/dvaUdZ9TFbSYsFrJyatcm8Byqphmbw8Fxon jXg= Date: Wed, 30 Sep 2020 15:50:41 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: Paul Eggert CC: Florian Weimer , Alejandro Colomar via Libc-alpha , Alejandro Colomar , , 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> <87tuvv5f24.fsf@oldenburg2.str.redhat.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-08.mgc.mentorg.com (139.181.222.8) 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 15:50:49 -0000 On Fri, 18 Sep 2020, Paul Eggert wrote: > On 9/18/20 7:34 AM, Florian Weimer via Libc-alpha wrote: > > the length modifier for printf and scanf is z, commently used as > > %zu or %zx (%zd is for ssize_t). > > While %zd works for ssize_t in glibc, POSIX doesn't guarantee that it'll work, > as ssize_t might not have the same width as size_t. (If memory serves this > goes back to the bad old days when size_t was 64 bits and ssize_t 32 bits on > some platforms.) So if we document %zd we should say it's a GNU extension to > POSIX, or something like that. %zd is for the signed type corresponding to size_t; that's in ISO C. The GNU extension would be a guarantee that ssize_t is the signed type corresponding to size_t (if we do guarantee that). -- Joseph S. Myers joseph@codesourcery.com