From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by sourceware.org (Postfix) with ESMTPS id 1B50C385C41B for ; Thu, 25 Aug 2022 16:43:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 1B50C385C41B Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linuxfoundation.org Received: by mail-ej1-x636.google.com with SMTP id lx1so4234465ejb.12 for ; Thu, 25 Aug 2022 09:43:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc; bh=Zej4CxY/1CWynJQcpIFCE/ePm/cZkXwlSREUqfzuJ8Y=; b=h5BQlI0xIEyNRWKjxWMt8RcIcaw6Iab9Lro//TN7cNvmYLCYmjHA9b7vqil1aO5lR2 jjncnbXB0E5n8vUT5r/OBW2cdzESp8HNiF0+6Am4i8gbPE/IF29BiN++mET+t+9HhGXy KU+7dVHbSPecBR62YILXw08KL2z9er7opHtdU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc; bh=Zej4CxY/1CWynJQcpIFCE/ePm/cZkXwlSREUqfzuJ8Y=; b=NGE04QswqZ/pwAXNrD24gIV4NtnYIm61y7CZiNM/8uL5REGZayTsnP6V0mWFSORmEy 9gOxHQZI4VOyV2PFqjmmjxmXg0rSAGUAFrjC2ps5WhLCxb0Cjpdzsvlla4vNtk4OeYry vCAcGYa7CsDd64e7p25CGuzFbtZ85sDGSXjcBYPaUdLjx6vtHI31XB1l4cr4UR9YuSUE q7KSMs5TLRtKx266PPakUjj/pzmGumZNgNZlvvGxUumt7wH5aHI+3zmJWjztS0phhMqQ 2pEy/Fi65JhUuhVY/jyCdhSIDDrrVgXdisX6EOMItpbsuLDjrHcrAr4Y2Utyj0ldblbp vLrQ== X-Gm-Message-State: ACgBeo2KKXt0adXE5DSKBHI5Fv+AhlYKw0GJnjx1uAqsskLMgphX6pv5 hGxH7lLRvOXPnBgViXsc2FNF0xAgFLgcJnniO2I= X-Google-Smtp-Source: AA6agR7Uj7UzmXLwsHdxM46xndPS/xUF3neBf7miIFN/jh61h3XQLYPlrL4u/nKlA3IG1tP1pYmRfQ== X-Received: by 2002:a17:907:3e07:b0:73d:760d:3e01 with SMTP id hp7-20020a1709073e0700b0073d760d3e01mr2994627ejc.136.1661445809451; Thu, 25 Aug 2022 09:43:29 -0700 (PDT) Received: from mail-wr1-f53.google.com (mail-wr1-f53.google.com. [209.85.221.53]) by smtp.gmail.com with ESMTPSA id vf7-20020a170907238700b0073dd99a0febsm593837ejb.188.2022.08.25.09.43.28 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 25 Aug 2022 09:43:28 -0700 (PDT) Received: by mail-wr1-f53.google.com with SMTP id e20so24836556wri.13 for ; Thu, 25 Aug 2022 09:43:28 -0700 (PDT) X-Received: by 2002:a05:6000:1888:b0:222:ca41:dc26 with SMTP id a8-20020a056000188800b00222ca41dc26mr2680808wri.442.1661445807749; Thu, 25 Aug 2022 09:43:27 -0700 (PDT) MIME-Version: 1.0 References: <20210423230609.13519-1-alx.manpages@gmail.com> <20220824185505.56382-1-alx.manpages@gmail.com> <87ilmgddui.fsf@oldenburg.str.redhat.com> In-Reply-To: From: Linus Torvalds Date: Thu, 25 Aug 2022 09:43:11 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v3] Many pages: Document fixed-width types with ISO C naming To: Joseph Myers Cc: 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 , David Laight , Cyril Hrubis , David Howells , Arnd Bergmann , Rich Felker , Adhemerval Zanella , Michael Kerrisk Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Aug 25, 2022 at 7:38 AM Joseph Myers wrote: > > 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. Yeah, that's going to help user space. We don't typically have huge issues with it (any more) in the kernel exactly because we refused to do the syntactically horrendous PRIxyz thing. So in the kernel, we still do have some format string issues, but they tend to be about "different architectures and configurations do different things for this type", and those different things are sadly not necessarily about a fixed width. IOW, we used to have horrors like "sector_t can be 32-bit or 64-bit depending on config options" (because small machines didn't want the overhead of having to pass 64-bit things around - from back when 32-bit was a primary target). We got rid of *that* thing a few years ago because it just wasn't worth supporting any more, but some similar issues remain. So we still have a number of cases of "if you really need to print this out, you need to use '%llui' and cast the value to 'unsigned long long'". But it's happily not as common as it used to be. Linus