Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp795328rwe; Thu, 25 Aug 2022 09:12:08 -0700 (PDT) X-Google-Smtp-Source: AA6agR4kopTofBjZS4wYH5PuaM0DenKUhpCLm3V2WgUY8LvrdhLKJVvdXe3hiTmGf38TIxlH/z9G X-Received: by 2002:a17:907:3ea5:b0:73d:85ec:453 with SMTP id hs37-20020a1709073ea500b0073d85ec0453mr2890389ejc.311.1661443927751; Thu, 25 Aug 2022 09:12:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661443927; cv=none; d=google.com; s=arc-20160816; b=e1F4CHxBkWP10+h6QOrF2Kl8sgI1XdHw6ZQWLC6Y9LKs4AYzK5pCSxWzgT7iG+BYNI ShgMr8UQPzNy87PR/yInDYrPSZd7BEVE4R9ttREjGTl6+fGZJ35MAvSlDYZQHjtMqHhr izGbnjPYUOM00I76CtTcivgRZBDPn06YraGVWfaNsa2vOVK9NAs3QTUmiUayP48C7Tgv 9p3HOARm0GY74H3pDPKrfyZFzETq6B9X/KwcqNM+WobE6ilqG4JwkihqIx+XIjA5aR3w 20j6fF+pyH52NsCTgT+K2PSqxDy+IY2V4wANcnyw/zFuW6ckBbhQwh3KdU5KLQK71WhG hSbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:message-id :in-reply-to:subject:cc:to:from:date:ironport-sdr; bh=WTI81EhMpUdaYL4mgzqIONBXobQbcOoVCAsTI7uyzTg=; b=zr3coPdUY7qbUGMN/bgTeP5TNfIrZV+y/ab+kTfGEhni93nhw515BAOAbzHtGIZQmd gG5UJNdXY4uMDHDgEb/dVSf5WwGGw8eOmr1OL4P+zwsort/eqVpL+NP06iBqYavUSPy9 NeYdhKnkOalcf3KH5N9i7YrJjJLwR1dfFzVpNCjDDU2h7faX3GhBxpgv76Di/WTxce9g r2vCm/GpgYR9HT92QG0sNBcy3T2MK3LAvcxm3jBrJpK7sb/ayV/VHazY8pUmpxgPRMcj E6xejXurwb/GtcIR2z/GdxZlnRIME19wHVjF6D8SBafPjySMCYCnCzwz4bNv7/aOW+z+ TQyQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u11-20020a50a40b000000b00446af98e042si5239321edb.101.2022.08.25.09.11.41; Thu, 25 Aug 2022 09:12:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241453AbiHYPw5 (ORCPT + 99 others); Thu, 25 Aug 2022 11:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbiHYPwz (ORCPT ); Thu, 25 Aug 2022 11:52:55 -0400 X-Greylist: delayed 482 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 25 Aug 2022 08:52:54 PDT Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com [68.232.129.153]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86E6E1AF3A for ; Thu, 25 Aug 2022 08:52:54 -0700 (PDT) X-IronPort-AV: E=Sophos;i="5.93,263,1654588800"; d="scan'208";a="84691156" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa1.mentor.iphmx.com with ESMTP; 25 Aug 2022 07:37:38 -0800 IronPort-SDR: gqfyrLBj4obLayYIodUELOeYAABsqQvo8uOyOawchBB2Q8+w5UxlnjBrn460q3ycd6wHjJqmjd gh7T7w/QcDRQ6tORaMlE5kUTFcOMmSI30/IrpvCk5Qd/qmt7O9jkSwCyju+AieGSqCOkgrFf0W SQJu/53xgPnTrY4XPza5ZHuv1txMaVQqNKYA+Dwut3Ev6jvZD46k0K/9jtxIlvngRv31VMDc5g PzxQEqscK8aPSncjQkN92X4fOOyz2DX2qWOKXKw1t+6Wr0Z6OmFLRCVUkUOLkHjinfKI7N5oFW iBQ= Date: Thu, 25 Aug 2022 15:37:27 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: David Laight CC: Linus Torvalds , Florian Weimer , Greg Kroah-Hartman , Alejandro Colomar , Alexei Starovoitov , Alex Colomar , Alexei Starovoitov , linux-man , Daniel Borkmann , Zack Weinberg , LKML , glibc , GCC , bpf , LTP List , Linux API , linux-arch , Cyril Hrubis , David Howells , Arnd Bergmann , Rich Felker , Adhemerval Zanella , Michael Kerrisk Subject: RE: [PATCH v3] Many pages: Document fixed-width types with ISO C naming In-Reply-To: <5e10ac07e63e41639b3113d12c264447@AcuMS.aculab.com> Message-ID: References: <20210423230609.13519-1-alx.manpages@gmail.com> <20220824185505.56382-1-alx.manpages@gmail.com> <87ilmgddui.fsf@oldenburg.str.redhat.com> <5e10ac07e63e41639b3113d12c264447@AcuMS.aculab.com> User-Agent: Alpine 2.22 (DEB 394 2020-01-19) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-Originating-IP: [137.202.0.90] X-ClientProxiedBy: svr-ies-mbx-15.mgc.mentorg.com (139.181.222.15) To svr-ies-mbx-10.mgc.mentorg.com (139.181.222.10) X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 25 Aug 2022, David Laight wrote: > From: Joseph Myers > > Sent: 25 August 2022 15:39 > > > > On Thu, 25 Aug 2022, Linus Torvalds wrote: > > > > > That's a small detail that yes, we've tried to avoid the absolute > > > humongous mess that the C standard library has with their horrendous > > > 'PRId*' mess, but honestly, it's just a tiny detail. > > > > I've not yet implemented it for glibc or for GCC format checking, but C23 > > adds 'wN' format length modifiers so you will be able to e.g. use "%w64d" > > with printf to print an int64_t and won't need those PRI macros any more. > > Is that meant to work regardless of whether the type is > int, long or long long provided the size is correct? > > Or does it require the compiler know which type inttypes.h > uses for uint32_t and uint64_t? The type passed needs to be that used for the relevant stdint.h typedef, not another of the same size. (For format checking, that means the compiler needs to know what the types used in stdint.h are.) It's now required that if int32_t exists, int_least32_t must have the same type, so int_least32_t can also be used with that format (and there are 'wfN' formats for int_fastN_t / uint_fastN_t as well). -- Joseph S. Myers joseph@codesourcery.com