From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adrien Mazarguil Subject: Re: cppcheck on dpdk Date: Wed, 16 May 2018 18:03:08 +0200 Message-ID: <20180516160308.GC6497@6wind.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dpdk-dev , Colin Ian King To: Ferruh Yigit Return-path: Received: from mail-wr0-f180.google.com (mail-wr0-f180.google.com [209.85.128.180]) by dpdk.org (Postfix) with ESMTP id 62202AAF1 for ; Wed, 16 May 2018 18:03:24 +0200 (CEST) Received: by mail-wr0-f180.google.com with SMTP id 94-v6so2007049wrf.5 for ; Wed, 16 May 2018 09:03:24 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, May 16, 2018 at 01:41:09PM +0100, Ferruh Yigit wrote: > Today after listening Colin's Static Analysis talk, I run cppcheck on v18.05-rc4 > code and it revealed some issues, sharing here for anyone to interested in > fixing them. At least I encourage to check maintainers to check their own pieces. > > It is really easy to run cppcheck, in dpdk source folder: > cppcheck --force . > > With above command cppcheck verifies all #ifdef paths, some issues below seems > related to this and that is why these issues not seen in build tests. > [drivers/net/mlx4/mlx4_flow.c:303]: (warning) Possible null pointer dereference: > mask False positive, a NULL mask means flow->promisc == 1, in which case this code isn't reached. > [drivers/net/mlx4/mlx4_rxtx.c:266]: (error) Shifting signed 32-bit value by 31 > bits is undefined behaviour > [drivers/net/mlx4/mlx4_rxtx.c:624]: (error) Shifting signed 32-bit value by 31 > bits is undefined behaviour > [drivers/net/mlx4/mlx4_txq.c:89]: (error) Shifting signed 32-bit value by 31 > bits is undefined behaviour > [drivers/net/mlx4/mlx4_txq.c:91]: (error) Shifting signed 32-bit value by 31 > bits is undefined behaviour Indeed, I'll send fixes shortly for these. Thanks! -- Adrien Mazarguil 6WIND