From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 22300 invoked from network); 2 Jun 2023 15:09:41 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 2 Jun 2023 15:09:41 -0000 Received: (qmail 3075 invoked by uid 550); 2 Jun 2023 15:09:39 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 2019 invoked from network); 2 Jun 2023 15:09:39 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:message-id:in-reply-to: references:mime-version; bh=pl4+RVNWiKexUOHS6NIzj97uIo3tVJlQfsIloqBdRYE=; b=qxZccPsJ+LGzTb3dVR+ow6mErPkvqk/z+bbPThG4sBKVHRwDETzDIlBZ ShEOq6QiDCiqAX4JVZ5n//b8/zy+lzdsb6KB0VUFMjb1oxrIaZ6QaBRpM fAWYYwK2OUqetqu3T1fjh/0X/KZnClMn/EWZp2o5gtJSQdyDAay4rduPJ E=; Authentication-Results: mail3-relais-sop.national.inria.fr; dkim=none (message not signed) header.i=none; spf=SoftFail smtp.mailfrom=jens.gustedt@inria.fr; dmarc=fail (p=none dis=none) d=inria.fr X-IronPort-AV: E=Sophos;i="6.00,213,1681164000"; d="scan'208";a="57713341" Date: Fri, 2 Jun 2023 17:09:26 +0200 From: =?UTF-8?B?SuKCkeKCmeKCmw==?= Gustedt To: Rich Felker Cc: musl@lists.openwall.com, jens.gustedt@posteo.eu Message-ID: <20230602170926.41dca6e7@inria.fr> In-Reply-To: <20230602143759.GQ4163@brightrain.aerifal.cx> References: <5a2c0731967330e9a3832d531ea4212e223aaead.1685429467.git.Jens.Gustedt@inria.fr> <20230602143759.GQ4163@brightrain.aerifal.cx> Organization: inria.fr X-Mailer: Claws Mail 4.0.0 (GTK+ 3.24.33; x86_64-pc-linux-gnu) X-Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAAXNSR0IArs4c6QAAACRQTFRFERslNjAsLTE9Ok9wUk9TaUs8iWhSrYZkj42Rz6aD3sGZ MIME-Version: 1.0 Content-Type: multipart/signed; boundary="Sig_/W10kMNCpeRUkcb0WEms.bHn"; protocol="application/pgp-signature"; micalg=pgp-sha1 Subject: Re: [musl] [C23 printf 2/3] C23: implement the wN length specifiers for printf --Sig_/W10kMNCpeRUkcb0WEms.bHn Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Rich, on Fri, 2 Jun 2023 10:38:00 -0400 you (Rich Felker ) wrote: > The logic here for whether w64 is LPRE or LLPRE is wrong. The > condition for whether [u]int64_t is long or long long is not whether > uintptr_t or long long would be too wide (they never are, in our ABIs) > but whether long is long enough. All our [u]intN_t are the lowest-rank > type of the desired size, and this seems to be consistent with what > other implementations like glibc do. I probably copied that logic wrong from somewhere. Yes, right thing is probably just to compare to the new `ULONG_WIDTH` macro or so. One thing to think about could be to always map 64 to `long long`, just for this function here. This would always have the right size and representation. And since this is an implementation of the C library, we make the rules ;-) > Short of a compelling reason not to, though, I plan to just go with > the fix-up of my v2 patch for this functionality. Its ordering avoids > duplication of logic (the ?: branches in the cases above) and the need > for maintaining extra side state (the width variable) thru the state > machine. I thought a bit of having the state only in the width variable, but since we also need to track signedness and the extra cases for FP, this becomes quickly quite messy. So yes, looks good (with some minor remarks in up-thread). Thanks J=E2=82=91=E2=82=99=E2=82=9B --=20 :: ICube :::::::::::::::::::::::::::::: deputy director :: :: Universit=C3=A9 de Strasbourg :::::::::::::::::::::: ICPS :: :: INRIA Nancy Grand Est :::::::::::::::::::::::: Camus :: :: :::::::::::::::::::::::::::::::::::: =E2=98=8E +33 368854536 :: :: https://icube-icps.unistra.fr/index.php/Jens_Gustedt :: --Sig_/W10kMNCpeRUkcb0WEms.bHn Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iF0EARECAB0WIQSN9stI2OFN1pLljN0P0+hp2tU34gUCZHoGJgAKCRAP0+hp2tU3 4navAKCJMw1iw84abUsConcCEzuKZEwUIgCglJZ4YaiqIkU9qeFEDJn2J+NU1H4= =jKs1 -----END PGP SIGNATURE----- --Sig_/W10kMNCpeRUkcb0WEms.bHn--