From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pg0-f45.google.com (mail-pg0-f45.google.com [74.125.83.45]) by dpdk.org (Postfix) with ESMTP id 3211C7CF8 for ; Thu, 4 May 2017 18:38:15 +0200 (CEST) Received: by mail-pg0-f45.google.com with SMTP id q4so3569454pga.3 for ; Thu, 04 May 2017 09:38:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=g1LAb7t6SG47RHLqkxTYxv5OvDb8DRr3/Ge/3L3LzL0=; b=bIphdbLbrGHK+RHz9tsCHAemPRffupVPaPnAd8YW/nejpdHeRtpzkAx62r62tpnvOe MjCgDN0BI2KM1qIc+UTWGahZkpkkpe4ndzC+sShPEJhrvUSYtUxlqNNpJPxcrNdpvJoA fcZZ4wLbX9zIaRBLrdxmOe8sO7U2PoX7Gp3h4pTzXClyd+MPs2UphxxXYDbEgkCtgwW4 o5vTjXQu8FiaxU/f3A0ianPh3CvUFynIzIQ2CSjQzdXtORxO2kdih0+KqM+d+uBjKAHW TDxwItIDDe+y2MIrTJ3uTh1wxFmgG6ipBReNwFQL8Tcjkl2+w01BagAVKtq3+SkbKlTE c+gA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=g1LAb7t6SG47RHLqkxTYxv5OvDb8DRr3/Ge/3L3LzL0=; b=kBUEdEUJUYgSbgbB9PQCu5jXf4s+JwtRy/ANLyje+8+W1+BwKnkBATFMTxThFKTl1+ UhP8//8LixVHmj42ucfWgrToCnmI8dn+kGNQdVsFeB81aiCUz8yT3qg3Y6rjnSkBvnhC Q37m5sEJzRdiYnVBFkwekMeJ8p3rQ46SYWaWKS4L3jd9Wa/8ZgkQiCNRKYnsdKVLTDEW nnGmKJF1xjtIWIQ1GJqp6V+i28Jo5PhZyXpWWxAX5gcRQm00S0It7RwsSXzpiuaelt5B gNBYpppIQyzvktYjopW3vyN0z0B7bpxM8UFZ+8vvnejlOsgb20CW6NYgAKwk5/t5O4mS safQ== X-Gm-Message-State: AN3rC/72KI+4A8sRFxFtboy2cERFcSClDw/xyM0wMqPFJYfNbpR6Jiv4 TShumClYGjsXzA== X-Received: by 10.98.215.85 with SMTP id v21mr8516208pfl.121.1493915895250; Thu, 04 May 2017 09:38:15 -0700 (PDT) Received: from xeon-e3 (76-14-206-252.or.wavecable.com. [76.14.206.252]) by smtp.gmail.com with ESMTPSA id 20sm7313770pfq.42.2017.05.04.09.38.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 04 May 2017 09:38:15 -0700 (PDT) Date: Thu, 4 May 2017 09:38:08 -0700 From: Stephen Hemminger To: Bruce Richardson Cc: dev@dpdk.org Message-ID: <20170504093808.12ea9c07@xeon-e3> In-Reply-To: <20170504153822.19461-2-bruce.richardson@intel.com> References: <20170504153822.19461-1-bruce.richardson@intel.com> <20170504153822.19461-2-bruce.richardson@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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: Thu, 04 May 2017 16:38:16 -0000 On Thu, 4 May 2017 16:38:13 +0100 Bruce Richardson wrote: > There are two new warnings in GCC 7 that cause problems in the DPDK > compile. > > 1. GCC now warns if you have a switch fall-through without a suitable > comment indicating that it was intentional. The compiler supports a number > of levels of warning which are triggered depending on the type of message > used, with level 3 being the default. To accept a wider range of possible > fall-through messages, we adjust this down to level 2. > > 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. > > Signed-off-by: Bruce Richardson > --- > mk/toolchain/gcc/rte.vars.mk | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/rte.vars.mk > index 5caa600..3834e00 100644 > --- a/mk/toolchain/gcc/rte.vars.mk > +++ b/mk/toolchain/gcc/rte.vars.mk > @@ -99,5 +99,12 @@ ifeq ($(shell test $(GCC_VERSION) -lt 47 && echo 1), 1) > WERROR_FLAGS += -Wno-uninitialized > endif > > +ifeq ($(shell test $(GCC_VERSION) -gt 70 && echo 1), 1) > +# Tell GCC only to error for switch fallthroughs without a suitable comment > +WERROR_FLAGS += -Wimplicit-fallthrough=2 > +# Ignore errors for snprintf truncation > +WERROR_FLAGS += -Wno-format-truncation > +endif > + > export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF > export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS Please fix the code not neuter warnings