From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by dpdk.org (Postfix) with ESMTP id E55702B9E for ; Fri, 5 May 2017 14:18:07 +0200 (CEST) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 05 May 2017 05:18:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.38,292,1491289200"; d="scan'208";a="853259163" Received: from irsmsx105.ger.corp.intel.com ([163.33.3.28]) by FMSMGA003.fm.intel.com with ESMTP; 05 May 2017 05:18:05 -0700 Received: from irsmsx102.ger.corp.intel.com ([169.254.2.153]) by irsmsx105.ger.corp.intel.com ([169.254.7.163]) with mapi id 14.03.0319.002; Fri, 5 May 2017 13:18:04 +0100 From: "Van Haaren, Harry" To: Thomas Monjalon , "dev@dpdk.org" , "Richardson, Bruce" , Stephen Hemminger Thread-Topic: [dpdk-dev] [PATCH 01/10] mk: adjust gcc flags for new gcc 7 warnings Thread-Index: AQHSxYcCqvUbiPjlX0aketFnrDBnpqHlp6sA Date: Fri, 5 May 2017 12:18:04 +0000 Message-ID: References: <20170504153822.19461-1-bruce.richardson@intel.com> <20170504093808.12ea9c07@xeon-e3> <20170505094213.GA42716@bricha3-MOBL3.ger.corp.intel.com> <1947779.Ji6X4lE9fr@xps> In-Reply-To: <1947779.Ji6X4lE9fr@xps> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiN2YxYzYzNGItNTNlOC00MTQ0LTkzNDItM2FhZTQ3MjdjZTJlIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX0lDIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE1LjkuNi42IiwiVHJ1c3RlZExhYmVsSGFzaCI6IlBMTGNzV25wZ05Hb25hWHBwMEZac015ZlJZb3Nmd1JPYlFlZEowU1VpbzA9In0= x-ctpclassification: CTP_IC dlp-product: dlpe-windows dlp-version: 10.0.102.7 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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 12:18:08 -0000 > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Thomas Monjalon > Sent: Friday, May 5, 2017 11:03 AM > To: dev@dpdk.org; Richardson, Bruce ; Stephen= Hemminger > > Subject: Re: [dpdk-dev] [PATCH 01/10] mk: adjust gcc flags for new gcc 7 = warnings >=20 > 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: >=20 > 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 a= nd the > > > > return value is not checked. Given that we often use snprintf in DP= DK in > > > > place of strncpy, and in many cases where truncation is not a probl= em, 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 +=3D -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. >=20 > 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 >=20 > I suggest to disable this new warning in GCC 7. > Any opinions? +1 to disable, it seems a pragmatic solution in this case.