Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp846713pxy; Wed, 5 May 2021 15:42:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxU0oJd237b0w8LZVZVWLYJgnHcClj1f6UXWYWFXi/pAish1b9VbtvFjAnRKeefuZGlrz/Q X-Received: by 2002:a17:90a:d512:: with SMTP id t18mr13729162pju.108.1620254530738; Wed, 05 May 2021 15:42:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620254530; cv=none; d=google.com; s=arc-20160816; b=g8ZOZm7qQ4RCuqMsGK/t0Ntur6XyizeYWineOi0flF87hOm55tPjRiGfN4MtG8xBDI vbc0y2j2WMk97d6dFHdzaSj3lPNqJXzpLDOb4rVCYP3u+Ejvt1KdVcDBzN59q8i6rwkn yXUzMuwHojqFaiZj9tY9D5pxjuabbdL0Fnc31cTLzcf8hHSa9QQqIenx/kCBL+WwEiZW gWr3ZhyUPcwUeP3CGndtgySpiqs5//EN2bra2ljhM8G+0wM0eJ8L2F8OgsAum7HyXKfp g93sVidBJ3NTa9huQYuv7brfd+frVLOM51e0A6FmtCWEuKVs8SAT1xyBgKsITH5mS/6i RKNg== 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:ironport-sdr; bh=AnnWxHTaqzntoIHmJoLQIweA21DXiYjxT56NeWeeyrE=; b=ZZIY4UG8tM8QoZG601zy/E8zRB/tDrqBqnnP3jcc4z80T81Z3owgaBurz/f6vTfO90 owUKR5msD0T1vqttR0Nb8tFjGmGnAxG4rrSsj+8KpaDUwTKrQ9P4iA925j6PaaGpBo1r 8T+BEQFsU+Sm9jxYeExO3FPB50VbH0zhxVoKX0iIngfW+oToOIYjP4dK396DsCEcGv55 Bwa4s5GSgT1if8vcPEDN7/ZGN53WleeXZW8Bt8zb6IMBr2uRsDbys3Oamm2zCYlOUJJ6 HaQEhqwMv0aL+jw4Awc5cMvr+wOw1Ed+mos/kpfQ3TXIk2svRdNMGbCSaaKQ5uv5flpC +bGQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si598050pgp.116.2021.05.05.15.41.57; Wed, 05 May 2021 15:42:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234044AbhEEWXV (ORCPT + 99 others); Wed, 5 May 2021 18:23:21 -0400 Received: from esa4.mentor.iphmx.com ([68.232.137.252]:57192 "EHLO esa4.mentor.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229897AbhEEWXU (ORCPT ); Wed, 5 May 2021 18:23:20 -0400 IronPort-SDR: SlZz+qtjNJar1cuRTb3RsH2YyzRNfwRCERsi+CelErtf0Bp4FqQ01OJSEXCDBT70XCy9wZcnGV CpVP5ZArBBhesEl4raRJKGxmRMY3Cwe0N4CzCcIA3hg35SZGJhvm6yWoylwlAFdZHUl2uwVWgy FdkYI3HWLg5BDOEOVa2ykGtmamv7ax/XaVQzVhkQNdS/n1xg04k44V7Z2CPO7gqlobb/25KzUr 77KM7Y7esxA38v0VSAL7fFdtmE15L0TeNQTu8R2LnaHhWMa2lYGNUNnwCaqwdiFyrkXOGJ9uNO LC0= X-IronPort-AV: E=Sophos;i="5.82,276,1613462400"; d="scan'208";a="61033681" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 05 May 2021 14:22:23 -0800 IronPort-SDR: yYRQC2BGZ2EAkI+dghDlrq62ctnEzUdDXVCbEBB5v6z8SaTasrZVI5bDosiuTWtKQ2NxHxdwWc 3oaEz2Y7c647UoXHvp0Jj2i9+uTeeFU1nNVPEyxqSbzUptTVOede61SgQjqXAIbOkz6stZVKDn mIPzoD9dlTOxe3+0gwdVKx2TfSeRTKAuPj/prdhV8xBVRK9GeA3DHNoj16s0xugWhT0J5x8xoZ cXwQBuJ8n5lEUZvbfkJnbYidEW5iYccXWAiDJhogWxOLWMfHI0nrP95kZXqh7LHnNFKdajOksb CZc= Date: Wed, 5 May 2021 22:22:18 +0000 From: Joseph Myers X-X-Sender: jsm28@digraph.polyomino.org.uk To: David Laight CC: 'Florian Weimer' , "Alejandro Colomar (man-pages)" , linux-man , Daniel Borkmann , Greg KH , LKML , GCC , "Michael Kerrisk (man-pages)" , glibc , bpf , Alexei Starovoitov Subject: RE: [RFC v2] bpf.2: Use standard types and attributes In-Reply-To: Message-ID: References: <20210423230609.13519-1-alx.manpages@gmail.com> <20210504110519.16097-1-alx.manpages@gmail.com> <69fb22e0-84bd-47fb-35b5-537a7d39c692@gmail.com> <6740a229-842e-b368-86eb-defc786b3658@gmail.com> <87r1imgu5g.fsf@oldenburg.str.redhat.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-02.mgc.mentorg.com (139.181.222.2) To svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 5 May 2021, David Laight via Libc-alpha wrote: > > __u64 can't be formatted with %llu on all architectures. That's not > > true for uint64_t, where you have to use %lu on some architectures to > > avoid compiler warnings (and technically undefined behavior). There are > > preprocessor macros to get the expected format specifiers, but they are > > clunky. I don't know if the problem applies to uint32_t. It does > > happen with size_t and ptrdiff_t on 32-bit targets (both vary between > > int and long). > > uint32_t can be 'randomly' either int or long on typical 32bit architectures. > The correct way to print it is with eg "xxx %5.4" PRI_u32 " yyy". C2X adds printf length modifiers such as "w32", so you can use a friendlier %w32u, for example. (Not yet implemented in glibc or in GCC's format checking.) -- Joseph S. Myers joseph@codesourcery.com