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 400EBA0A0A; Thu, 20 May 2021 09:48:56 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id AF43240143; Thu, 20 May 2021 09:48:55 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) by mails.dpdk.org (Postfix) with ESMTP id EAB8040041 for ; Thu, 20 May 2021 09:48:54 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 81EDF5C0101; Thu, 20 May 2021 03:48:54 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 20 May 2021 03:48:54 -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= eRrqwmfRt2z9uitfKjamCxKiL8PgqF6BfXHjVrPXqHw=; b=NRdvYL/SEcdOgLTj hVE04rOQI2tqb9SrdekZGoENwarQRn+IUHads4+uxUeznjqJc2QYebFPknVGazMf hzUiymVIXbQqiNYodLxubC6xtp3jChteK4divPW4UnSkwgxHC3UBg1OsRY5UEyR+ gCPLqXxBajRvkceGR1NJTzLO5qFmxt5O0s/7Ebv/liez35wyhBTDwP57Z+9caOn0 tKm1s+9CdhwNvn7OLlpg62LReY/v3VyivgTWKlK8bctoc2dc3sF8FZE/tLLOICzY zNXEKtNjom80KtKGsG537zYA9uXXKuIs5WR0pDpRKYjevcW6l5oqOsy8e47iNodb BuITng== 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=eRrqwmfRt2z9uitfKjamCxKiL8PgqF6BfXHjVrPXq Hw=; b=rWrv4CAvsCMHsdf5ZgbZqsVrk3l92V6L6TignIupTZax8QZzksWBp6HTd 9oXTelROYStFZLQg49SnpTmJezrua03j9DqtTsPF9KQQdzvnK+kMMBuoj3mbzZKW zmH2Kx9sxsWEIHJ1ECxNARJWmCzy47vip6ewOOOByJAC0mImtyIsnrixnwQfiF67 3fDsAkAdreT9LT5nA15GLRUnuBPz0A7amV76zpyncMLw4hFRO1oRpMx16mg4o32F yUYs3IoKo2zxhs/hE0YV58lG1BBF0tWinQzd9A0Ontasx8Ly2MmlxGvo3yYIExxV zyyfSWtSEcClqb9NGqDhd8ootjiiA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdejtddguddvhecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth 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; Thu, 20 May 2021 03:48:53 -0400 (EDT) From: Thomas Monjalon To: Ferruh Yigit Cc: dev@dpdk.org Date: Thu, 20 May 2021 09:48:52 +0200 Message-ID: <1872524.lENsVPqTGR@thomas> In-Reply-To: <20210211172758.2977369-1-ferruh.yigit@intel.com> References: <20210211172758.2977369-1-ferruh.yigit@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] devtools: add cppcheck wrapper 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" 11/02/2021 18:27, Ferruh Yigit: > +CPPCHECK_BIN=cppcheck > +out=cppcheck_error.txt In general we generate files in $(mktemp -t dpdk.cppcheck.XXXXXX) The path is printed at the end anyway. > + > +which ${CPPCHECK_BIN} > /dev/null 2> /dev/null > +if [ $? -ne 0 ]; then > + echo "${CPPCHECK_BIN} is missing!" Curly braces are not needed. > + exit 1 > +fi > + > +print_usage () { > + cat <<- END_OF_HELP > + usage: $(basename $0) [-h] [path] > + > + Wrapper on checkpatch tool. Output goes to ${out} file. s/checkpatch/cppcheck/ > + > + Without parameter current folder with all subfolders scanned. It is possible > + to provide a sub-folder to recude the scan to that folder. A bit hard to read :) > + END_OF_HELP > +} > + > +if [ "$1" = "-h" ]; then > + print_usage > + exit 1; > +fi > + > +dir=${1:-$(dirname $(readlink -f $0))/..} > +if [ ! -e ${dir} ]; then > + echo "\"${dir}\" is not valid folder/file to check" > + exit 1 > +fi > + > + > +suppress_args=" > + --suppress=invalidPrintfArgType_sint \ > + --suppress=invalidPrintfArgType_uint \ > + --suppress=duplicateAssignExpression \ > + --suppress=nullPointerRedundantCheck \ > + --suppress=identicalConditionAfterEarlyExit \ > + --suppress=objectIndex > + " > + > +# all, warning, performance, portability, > +# information, unusedFunction, missingInclude > +additional_checks=warning > + > +${CPPCHECK_BIN} \ > + -j64 \ > + --language=c \ > + --enable=${additional_checks} \ > + --force \ > + ${suppress_args} \ > + ${dir} \ > + 2> ${out} Is it possible to have only errors by default in the output, and add all lines about what is being checked in a verbose mode? > + > +if [ $? -eq 0 ]; then > + echo -e "\nOutput saved to ${out}" Please prefer printf. > +else > + exit $? > +fi The report has 2000 lines of defects, and it seems to have lots of false positive. Is it possible to reduce them?