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 C43F4A0548; Wed, 19 May 2021 21:25:00 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 3357440041; Wed, 19 May 2021 21:25:00 +0200 (CEST) Received: from wout3-smtp.messagingengine.com (wout3-smtp.messagingengine.com [64.147.123.19]) by mails.dpdk.org (Postfix) with ESMTP id 0369D4003F for ; Wed, 19 May 2021 21:24:57 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id BD8361A81; Wed, 19 May 2021 15:24:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Wed, 19 May 2021 15:24:55 -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; s=fm1; bh=drGRiOlPBilLK PARZ4ZC5bd5xVyFeq7kFxnGPFSknjs=; b=VCAbmaEQYb3JJhiLjApnOM8C/YL2x D8FFH21p0M5v/6VnD2RM0jv9IeGNZQOs8u7+SL2sgtACvhcC0bwfuO1xu+FDRYt8 rkAFUXWMWxTlHXQo72tX4/6ZiknSzs6Sq/otjXEwKYEPanlbfvjG65hZ+xLxTOVW Ur8m0zIbpWRNfTyjnQdd6WEFzqaVnbhbje3on2IokT9mAzMSmwPGJziJKZS22DAi wSTSQp9CX1uaDBMTAymuuA03y2rcDEIR4eAQfrOoACIJjB6HGUfJuDBhII0Uwv2t LwkL0lkDl+0VW9gfC4tp4o0CxSKYhhAt/NZsSltK0tjli8rzQicpvQb8A== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding: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=drGRiOlPBilLKPARZ4ZC5bd5xVyFeq7kFxnGPFSknjs=; b=lzuH04jB kCYWfX9exlXQL38+Z+1PVb/7Xu0r8zI6JJ17o7AU/SwrCps/AcbiqDUfxMPm3nU/ QfKpd/83DV5dpPqCDQoJj+Tw0YL+EnzwF+n1SXSiqQQ5qsTmZR4adrWEU9l7RmqM O+q2zIb+1hUeKy2Nh+vIKDk6oOFd/pQdxNuWqyb2kb4zOc6oPxwapvoL75nw7Qk6 mIHgFrtvehMsqQFB2LLlWKBRWFXrhPS3dqvsrXKsovMwro0rcHQgAw5AGnquK+TH eHOV1d3uXJJeEroW2AzPIaeRhr/VtHrgM6gbAhUGp19aTeSv1fyydV1e5SxIKjD2 OLGO8tW2XtnJbQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeiledgudefgecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedvhefgiedvjeegtdevheefhfetleefgfeivefgffevfeejgedt gfeutdehtdegveenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.monjalon.net (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 19 May 2021 15:24:53 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Ferruh Yigit Date: Wed, 19 May 2021 21:24:49 +0200 Message-Id: <20210519192449.2688051-1-thomas@monjalon.net> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210209152643.1832506-1-ferruh.yigit@intel.com> References: <20210209152643.1832506-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [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" 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 --- devtools/checkpatches.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh index db4c7d8301..0e09b2cab8 100755 --- a/devtools/checkpatches.sh +++ b/devtools/checkpatches.sh @@ -69,6 +69,14 @@ check_forbidden_additions() { # -f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \ "$1" || res=1 + # 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 + # forbid variable declaration inside "for" loop awk -v FOLDERS='.' \ -v EXPRESSIONS='for[[:space:]]*\\((char|u?int|unsigned|s?size_t)' \ -- 2.31.1