From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=IzxeswFRl4mxkaAL6MQivFYKsRHzLXMAPop/Us1Hmq0=; b=GDh48sWPrJNUnu5XrEjEtxXaRGJi+OCNv/GWkQk4w/YPnxSTGzw54/OnMClyaV4cW8 ZTQg/EAtSytpDadBuv1vfb67h2E5pSNvPFfqlba1u3bJOMVgJzZjOFXuDUmZVjrQ0bte OYtFpGiRZ9eYseTSAbfow1Vo8wVhvm+7Obt+GqPsb/0k/6SdVUJ2H/c5VH2mwdAliJb5 RVe8qV3A1Gi6TOKneRat1JYuo7FHpwsmRKBqzcgq4wk2MN8EU1SUYXUz9CHuwYuLq/+R yG1wTxdkyZYF0oyoC+Ru4djQA4FaGiPFV0hU65hiOza9/3QDbUItfs9yDHcKel/JrHSo NnvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=IzxeswFRl4mxkaAL6MQivFYKsRHzLXMAPop/Us1Hmq0=; b=Eq+8GtrwqVciC9gcb2YoAclMD3bS5EwE5Vl8ueWOH/FsuKlB0idodVXnxHJfevq/H7 7zVWTrVGB0+03WvCJQhUvV1GV8Ex8fgIRkscLdUlDXJhaVvokguEwJ1qE1jxC0UD2XdM QXJIZmE82BGijBCvpncV92Q997naMsJJoGTaFMW6fQaHApn/NIRMxaOgLXHw/+bAjE8k 5Ezuz7wfcwUBaI9RFvheCQYmUE/74BAaqByBAsgyvYT8C+ka+MnlQG2urwcZsz/Abhuw S96wdMBaj3WV3TedylDIlirElXRpztMnM0bJ4Bw1nvljT5Cl6sTFOealnn4o0r3VSM7U g2Cg== X-Gm-Message-State: ALKqPwcHlI/sWIHw6Zf262HQcSHFCFxxZJ8rzGOgCZU8UmQEz4GN74Dc TH5ufdNRsdil+/6JX0zeEz8J8w== X-Google-Smtp-Source: AB8JxZrLtNoktsvmImPkRdQ8zoc6ZVSgfvh/5h8bkRRZrGnuTmiRCbF27/i4codSF+dXpgX6PCloKA== X-Received: by 2002:adf:c5cb:: with SMTP id v11-v6mr1272950wrg.151.1526486604093; Wed, 16 May 2018 09:03:24 -0700 (PDT) Received: from 6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id b11-v6sm3816376wrf.50.2018.05.16.09.03.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 May 2018 09:03:23 -0700 (PDT) Date: Wed, 16 May 2018 18:03:08 +0200 From: Adrien Mazarguil To: Ferruh Yigit Cc: dpdk-dev , Colin Ian King Message-ID: <20180516160308.GC6497@6wind.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [dpdk-dev] cppcheck on dpdk X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 May 2018 16:03:24 -0000 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