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.5 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_LOW,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 7506 invoked from network); 31 May 2023 14:05:46 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 31 May 2023 14:05:46 -0000 Received: (qmail 15477 invoked by uid 550); 31 May 2023 14:05:12 -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 14313 invoked from network); 31 May 2023 14:05:10 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=fpxyLNlxMYtg/A4GP5DX6E0fKUgTgXEaC7FCzqRsqoo=; b=pRzsjbLujKj5+uOqyAGNJh4SxoeFRP93yUNekb9Qgy4L2O/vG96Hg1X3 UZFTA1cU4r+9XSkKWBcB+fS01aQbyB9nmB9UBJbE6LwhE5Kok1zrXiHF6 zIsSFwyKrVv4sNN//6Dr1xHlYAzSDgbDjAZ4aYDiL89MjgGiREROJ9IGo g=; Authentication-Results: mail2-relais-roc.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,207,1681164000"; d="scan'208";a="110511368" From: Jens Gustedt To: musl@lists.openwall.com Date: Wed, 31 May 2023 16:04:53 +0200 Message-Id: <56551ec27151cd29ff871c0db3a89e21c2b5135f.1685535897.git.Jens.Gustedt@inria.fr> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [musl] [C23 printf 3/3] C23: implement the wfN length modifiers for printf Musl only has a difference between fixed-width and fastest-width integer types for N == 16. And even here all architectures have made the same choice, namely mapping to 32 bit types. --- src/stdio/vfprintf.c | 3 +++ src/stdio/vfwprintf.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c index 265fb7ad..a531a513 100644 --- a/src/stdio/vfprintf.c +++ b/src/stdio/vfprintf.c @@ -534,8 +534,11 @@ static int printf_core(FILE *f, const char *fmt, va_list *ap, union arg *nl_arg, ps=st; st=states[st]S(*s++); if (st == WPRE) { + _Bool fast = (*s == 'f'); + if (fast) ++s; if (*s == '0') goto inval; width = getint(&s); + if (fast && width == 16) width = 32; } } while (st-1