From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id AC623A0A02; Fri, 21 May 2021 15:09:41 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3026040686; Fri, 21 May 2021 15:09:41 +0200 (CEST) Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by mails.dpdk.org (Postfix) with ESMTP id 865C940143 for ; Fri, 21 May 2021 15:09:39 +0200 (CEST) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 07961162C; Fri, 21 May 2021 09:09:37 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Fri, 21 May 2021 09:09:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm1; bh= XboSwX6h6twsozIDF221kjcawRTKDRqt6Ou4FvzLuzc=; b=3CE8bGKMxlyv8GPz ZNbkj+d2fySHcb2c7iCmzHVhf2XI2agY2V4TD0oKPIdP89wYqzgQZavY6JAPHSw1 r6GH/ast5KZJnwkqDEKSRRXZSsVbKpfb9DWYRpyM7+CeaVv6i3QbNNL7joiAGpCy Qq7POL8vxemJcghZ5mAbAhAvmkaxgRpcSPWQ4gonzLzVcyHZlf7Irm31PAbY8p+J kvF0GZoX5TFO9hXk0HQQ56c8iUKrvg5WoSe//Va1QZ7Aj6NvawgkuZwAmTuGg1HT QOjnTQ0lj2oxrT8qMpXxb/Frk93MOKan0YCpxV7qcTyRked1qiQrcwJ9HpVFYUOe tqu8EA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=XboSwX6h6twsozIDF221kjcawRTKDRqt6Ou4FvzLu zc=; b=YFwu0s9GwdwjyI2JumUDJkp11cW0Oy3qJr/p/GCT/KPTgT5dYVx1ZdaG1 a6YxsGwsGIasxPpnMP7KQffxQuuv6byRi/Aer02MU6U4hLuANHivTddSayDIQ9e4 +AxD64rA6lGBngCqtY1+qofs6OrrCD4Xmht+7kVUGBXVk4WC6njRMK9ki1n5UMkg mU45SLxKikSNqcDeOi/hMcjwcUaj/LnivTdqLTKvFhRvVRzSc2853eLgzMQlC4jt krQecDKC1JdlkqIXe70z8dXYlozD9iyHuhtaMHgI00J2uPWz0CeRo0UaBmJSgisg KO0BIzL7i1nKRxC67mTv8J+/VSaYA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejfedgieduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkfgjfhgggfgtsehtufertddttddvnecuhfhrohhmpefvhhhomhgr shcuofhonhhjrghlohhnuceothhhohhmrghssehmohhnjhgrlhhonhdrnhgvtheqnecugg ftrfgrthhtvghrnhepudeggfdvfeduffdtfeeglefghfeukefgfffhueejtdetuedtjeeu ieeivdffgeehnecukfhppeejjedrudefgedrvddtfedrudekgeenucevlhhushhtvghruf hiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhhomhgrshesmhhonhhjrghl ohhnrdhnvght X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 21 May 2021 09:09:36 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org, david.marchand@redhat.com Date: Fri, 21 May 2021 15:09:34 +0200 Message-ID: <1768737.eMR6Yis3Ie@thomas> In-Reply-To: <4ed3f134-a54d-9993-704b-6de1157f5fae@intel.com> References: <20210209152643.1832506-1-ferruh.yigit@intel.com> <20210519192449.2688051-1-thomas@monjalon.net> <4ed3f134-a54d-9993-704b-6de1157f5fae@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v2] devtools: check %l format specifier X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" 21/05/2021 14:01, Ferruh Yigit: > On 5/19/2021 8:24 PM, Thomas Monjalon wrote: > > From: Ferruh Yigit > > > > %lx or %llx tend to be wrong for 32-bit platform > > if used for fixed size variable like uint64_t. > > A checkpatch warning will avoid this common mistake. > > > > Signed-off-by: Ferruh Yigit > > Signed-off-by: Thomas Monjalon > > --- > > v2: proposal to reword the message and comment > > --- > > + # check %l or %ll format specifier > > + awk -v FOLDERS='lib drivers app examples' \ > > + -v EXPRESSIONS='%ll*[xud]' \ > > + -v RET_ON_FAIL=1 \ > > + -v MESSAGE='Using %l format, should it be %PRI*64?' \ > > + -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ > > + "$1" || res=1 > > Using the %l or %ll format specifier is correct when the variable type is "long > int" or "long long int", it is only wrong if the variable type is fixed size > like 'unit64_t'. > > My concern is above warning log may cause people change the correct usage. > > That was why I tried to make wording less strict, more like a reminder to double > check the usage. This is a question now: "should it be", why do you think it is strict? > If we can check that format specifier is used for 'unit64_t' variable, that will > be the best solution but that is very hard to do. > Should we add a little more information to the message to prevent false hit on > the correct usage? Your message was: "Please check %llx usage which tends to be wrong most of the times" Mine: "Using %l format, should it be %PRI*64?" Trying to give more info about what can be wrong while keeping short: "Using %l format, is it a long variable or should it be %PRI*64?