From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by dpdk.org (Postfix) with ESMTP id 572C91B517 for ; Wed, 19 Dec 2018 10:24:31 +0100 (CET) Received: by mail-wm1-f66.google.com with SMTP id f81so5570342wmd.4 for ; Wed, 19 Dec 2018 01:24:31 -0800 (PST) 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:content-transfer-encoding:in-reply-to :user-agent; bh=IWxUkfuDhW8z1y3hwrBtGIrBQx7feBY1cFj0hoMKH4Q=; b=1rn1vk7o5sOy/3M5TchF1dEl5zARl19/IO/bpE1zy5AeznVlTk4zRE4VHTtv7xlu56 G0EX84vuHdx9AszF31LzwgxThpYHCSjHIxW636l1M5ciyiBhP5ctZZNFGv8woVJXDP4L bIh5oWQTx0BRyqYleKv/J2JZelEUdpQ/QJnfAkGdUMMraHqTvCMRjYeYlSy6LQ+uc5Nu kNPjmlVbKbUksFCbRxpZ+3nSYpkGMBcb3OqCy3tHojoUUh4+hec6N9PvoTC9WjAvNtF6 JPEe6kKu7a8UIFroC8IF9b855/oiVF8400F+z+6o2pVOBeBa2siMaasJ1sqQRhz5I74Y rw2A== 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:content-transfer-encoding :in-reply-to:user-agent; bh=IWxUkfuDhW8z1y3hwrBtGIrBQx7feBY1cFj0hoMKH4Q=; b=loUs1yADO2GYst4xZY/STv2Hx9EEX7l8EDejO8jp2kgF31H6Jzn92DnGc4Q3TV/FY1 /a7Dwt0ij7Rm0NHCmp/zciR5vqL7eaZdwvfsnX3ECK/NaQEZ0F7su1rvrEa6/dCWxDDT Y2UNFFHhklNxAEqa+rQAllnodRGJKadOJ6d3s6Mv2nPB8dRgPLxwwLJ+k2mBpR3qH9kS 0pxBMEM70hLiW1/bqSE/lpT4EqDNayi4IZmTBkW4V8x59zv7ZTzB1QK8y1j3WKi5vVmR aFP8AemrOHwTxQpLRItkVLyay/oYrphpddYNKzJdjiEo/aROnABLWZRYb1ekz/G7yvX5 Qp5Q== X-Gm-Message-State: AA+aEWZEi8ss/E9h2z8wfjbSc9l3XUYheH+0kgmvKrkb1sCIDOOfLmtz mkVB76vtOBdfyfvVXqXEIAwY6w== X-Google-Smtp-Source: AFSGD/X13I9/kY+AbY9CxHoLKuhjpjA6SZQ4H6vPLKZgoSct6G8K9DKwpeKT5MXqGQ6J50neBJRsYQ== X-Received: by 2002:a1c:1a43:: with SMTP id a64mr6107217wma.136.1545211470814; Wed, 19 Dec 2018 01:24:30 -0800 (PST) Received: from bidouze.vm.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id j24sm5668530wrd.86.2018.12.19.01.24.29 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 19 Dec 2018 01:24:29 -0800 (PST) Date: Wed, 19 Dec 2018 10:24:09 +0100 From: =?iso-8859-1?Q?Ga=EBtan?= Rivet To: Ferruh Yigit Cc: dev@dpdk.org Message-ID: <20181219092409.yrxltegt7e76zevy@bidouze.vm.6wind.com> References: <20181218102643.4332-1-gaetan.rivet@6wind.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Subject: Re: [dpdk-dev] [PATCH] mk: use misleading indentation warning when available 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, 19 Dec 2018 09:24:31 -0000 On Tue, Dec 18, 2018 at 02:50:30PM +0000, Ferruh Yigit wrote: > On 12/18/2018 10:26 AM, Gaetan Rivet wrote: > > -Wmisleading-indentation was introduced in GCC 6.0. > > It seems '-Wmisleading-indentation' is part of -Wall, which we already set by > default. If so no need to explicitly add it. > > The link I found: > https://www.gnu.org/software/gcc/gcc-6/porting_to.html > > copy-paste: > " > A new warning -Wmisleading-indentation was added to -Wall, warning about places > where the indentation of the code might mislead a human reader about the control > flow: > " > > Is there a way to confirm it is part of -Wall? > I think you are right, actually the check was already used. This is worrying, given that the original bug was not seen. This patch can be left out then, but the problem remains. Maybe an update to coding style is needed, or an evolution to checkpatch // preferably something else. > > > > Use it at least when available. This should catch most common > > error of the types (due to the codebase being properly tabbed), > > but will still miss patterns such as > > > > if (!condition) > > // commented_fn_call(); > > do_stuff(); > > > > Signed-off-by: Gaetan Rivet > > --- > > > > I completely agree that we should change the coding style and force > > all if()s to have brackets. > > > > In the meantime, this patch might help alleviate the issue. > > > > mk/toolchain/gcc/rte.vars.mk | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk > > index d8b99faf6..2c9bde1d5 100644 > > --- a/mk/toolchain/gcc/rte.vars.mk > > +++ b/mk/toolchain/gcc/rte.vars.mk > > @@ -87,5 +87,9 @@ WERROR_FLAGS += -Wimplicit-fallthrough=2 > > WERROR_FLAGS += -Wno-format-truncation > > endif > > > > +ifeq ($(shell test $(GCC_VERSION) -gt 60 && echo 1), 1) > > +WERROR_FLAGS += -Wmisleading-indentation > > +endif > > + > > export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF > > export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS > > > -- Gaëtan Rivet 6WIND