From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 1483D68C5 for ; Fri, 5 May 2017 12:02:46 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id B8F83209C4; Fri, 5 May 2017 06:02:45 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 05 May 2017 06:02:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=Ufa9HaCyqiQC0Fc 9GsGSYsnRoeQf/yLdihozrr0VKV0=; b=Cyo8UIgYZM63HYQDkmCDYJZYShB9ILn YpuPFxSbnmiP9YtFgaJ1VU8KEbU3Co0MyfD2B4myrvJw71bT0JIZynDfBBqyoKY1 pFoO4GpSYF2fPq6kuGwJGY3YKbV+R2KqQo7BE4mCWEFriK53mO3wyVc7QFYGLifK zrx+uiWRBSCA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc:x-sasl-enc; s= fm1; bh=Ufa9HaCyqiQC0Fc9GsGSYsnRoeQf/yLdihozrr0VKV0=; b=V3tBMyQv 5Czx0pGAivcm6jbVVQbAgatzUFo3JxTqdJHTGQaFnZQKbT/h5uhMgB34Tv65l2HH e5vkV9U3hUROMuguPHb1T7lur58dKBZswxRqDnISlvIGu4RsoMipsrpM0kAfcecg +JDmoVJm2rWfMWRxwXfoexuh3tIjJ4do0VGRvNGO3A7MCi/ZCAlgN1EOY9zchhYz YtUb+ZfICrkITjI6b5XUKNKWkt/z4k4odVtH3gI7dcr+He52slFdSWuXIo1ZBaNO KlhT5v9IW1sowfXNaro57yL0QNUoVAY/TP8gy5kZb/kdMLEspnrtLuy7lAcibyRP XghhvJpU8ut/Vg== X-ME-Sender: X-Sasl-enc: bPnZwDN/2kqc1yx68Ki35fIbRBcsme5mXLbrvoiC4dxR 1493978565 Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 6EC457E315; Fri, 5 May 2017 06:02:45 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org, Bruce Richardson , Stephen Hemminger Date: Fri, 05 May 2017 12:02:44 +0200 Message-ID: <1947779.Ji6X4lE9fr@xps> In-Reply-To: <20170505094213.GA42716@bricha3-MOBL3.ger.corp.intel.com> References: <20170504153822.19461-1-bruce.richardson@intel.com> <20170504093808.12ea9c07@xeon-e3> <20170505094213.GA42716@bricha3-MOBL3.ger.corp.intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH 01/10] mk: adjust gcc flags for new gcc 7 warnings 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: Fri, 05 May 2017 10:02:46 -0000 In this series, there are some fixes for fall-through comments, missing break and missing initializers. I think there is no discussion about accepting them in 17.05. The last item to discuss it the new snprintf warning: 05/05/2017 11:42, Bruce Richardson: > On Thu, May 04, 2017 at 09:38:08AM -0700, Stephen Hemminger wrote: > > On Thu, 4 May 2017 16:38:13 +0100 > > Bruce Richardson wrote: > > > 2. GCC also warns about an snprintf where there may be truncation and the > > > return value is not checked. Given that we often use snprintf in DPDK in > > > place of strncpy, and in many cases where truncation is not a problem, we > > > can just disable this particular warning. [...] > > > --- a/mk/toolchain/gcc/rte.vars.mk > > > +++ b/mk/toolchain/gcc/rte.vars.mk > > > +# Ignore errors for snprintf truncation > > > +WERROR_FLAGS += -Wno-format-truncation [...] > 2. for the format truncation warning, ideally, yes we should fix the > code, except that I don't believe this is feasible in the short term, > and I also don't believe it is desirable. We extensively use snprintf > because it has sane/safe truncation, and in many cases we don't care if > it is being truncated. Therefore disabling the warning seems the best > approach to me. Furthermore, if we want 17.05 to compile with GCC 7, > this is the best option within that timeframe. We could imagine an explicit ignore of the return code. However, do we really want this new coding rule for every snprintf? It is a common call in DPDK: git grep '\' | wc -l 774 And probably almost never checked: git grep '^[[:space:]]*\' | wc -l 660 I suggest to disable this new warning in GCC 7. Any opinions?