From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by dpdk.space (Postfix) with ESMTP id EEF00A0AC5 for ; Thu, 2 May 2019 15:31:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF5945F1C; Thu, 2 May 2019 15:31:04 +0200 (CEST) Received: from mail-ua1-f66.google.com (mail-ua1-f66.google.com [209.85.222.66]) by dpdk.org (Postfix) with ESMTP id CB8B85F1B for ; Thu, 2 May 2019 15:31:03 +0200 (CEST) Received: by mail-ua1-f66.google.com with SMTP id 90so696083uav.10 for ; Thu, 02 May 2019 06:31:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=cBUK+wqZ6lLBejOLFJYsBgIqro8YmvenEJdPJxrZ5Bs=; b=MxTpcd8Wwbc3p9JuB+fh6TPLt4CwwC5p2hZCgff/r/TyshUBJQOE0ErKU7tQk/DAit OdhvINBxDtvmwFwf54cyDA6rDKFKSCzTpsdDABwHrKWQID33lL+p6U/MibNmOOi1C+qm NJOrZeMMsGIJHmkBIvC7l14V1Y4EcdHT9bnd9P7c0psnccXtsD+4b/b4o/0tzntkIavW CBBT3LrpieWj48t2b3Mt9ZK/B9wtmTWaDNhb88FxRVj3fVR/jt+jzCcy4o5yGywOM00q y0N4vMPdwgtF76Y4UA7G1cl5SHB2Ux8MqX6MyuAJELRz/erx5M+05kzz10IsOjS11hpD u4kg== X-Gm-Message-State: APjAAAWZOGO9a2SCDfDC4zVRfNWXM4n7e8W6bf0uSZegKmowZ3gqtB9X Zqa+xhbuDFepehX7ApHVDTKdP9ZhOcvs5fKj/Ri1VQ== X-Google-Smtp-Source: APXvYqxxJQngx40w5UoQuLvPreE7fedIBM3m41e0gorr/pkBav8tqdWXRWnp3uKQ84IMCjdeoBcdt9HIbeZAwAa0Q/8= X-Received: by 2002:ab0:70d3:: with SMTP id r19mr1676156ual.126.1556803863053; Thu, 02 May 2019 06:31:03 -0700 (PDT) MIME-Version: 1.0 References: <20190502093334.7546-1-reshma.pattan@intel.com> <20190502132630.GD1980@bricha3-MOBL.ger.corp.intel.com> In-Reply-To: <20190502132630.GD1980@bricha3-MOBL.ger.corp.intel.com> From: David Marchand Date: Thu, 2 May 2019 15:30:51 +0200 Message-ID: To: Bruce Richardson Cc: Reshma Pattan , dev Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH] mk: disable warning with gcc 9 on Fedora 30 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Message-ID: <20190502133051.5QD-Jz2CAJ9B8bkEjE_P2daCG5wbvg-BNZDkNwthJbw@z> On Thu, May 2, 2019 at 3:26 PM Bruce Richardson wrote: > On Thu, May 02, 2019 at 12:07:17PM +0200, David Marchand wrote: > > On Thu, May 2, 2019 at 11:33 AM Reshma Pattan > > wrote: > > > > > gcc 9 on Fedora 30 gives an error > > > "taking address of packed member may result in an > > > unaligned pointer value" warnings. > > > > > > For clang builds this warning is already disabled, > > > so disable "-Waddress-of-packed-member" for gcc builds > > > also. > > > > > > Snippet of build error: > > > ...lib/librte_eal/linux/eal/eal_memalloc.c: In function > =E2=80=98alloc_seg_walk=E2=80=99: > > > ...lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error: taking > address > > > of packed member of =E2=80=98struct rte_mem_config=E2=80=99 may resul= t in an unaligned > > > pointer value [-Werror=3Daddress-of-packed-member] > > > 768 | cur_msl =3D &mcfg->memsegs[msl_idx]; > > > | ^~~~~~~~~~~~~~~~~~~~~~~ > > > > > > Signed-off-by: Reshma Pattan > > > --- > > > mk/toolchain/gcc/rte.vars.mk | 3 +++ > > > 1 file changed, 3 insertions(+) > > > > > > diff --git a/mk/toolchain/gcc/rte.vars.mk b/mk/toolchain/gcc/ > rte.vars.mk > > > index d8b99faf6..b852fcfd7 100644 > > > --- a/mk/toolchain/gcc/rte.vars.mk > > > +++ b/mk/toolchain/gcc/rte.vars.mk > > > @@ -87,5 +87,8 @@ WERROR_FLAGS +=3D -Wimplicit-fallthrough=3D2 > > > WERROR_FLAGS +=3D -Wno-format-truncation > > > endif > > > > > > +# disable packed member unalign warnings > > > +WERROR_FLAGS +=3D -Wno-address-of-packed-member > > > + > > > export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF > > > export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS > > > -- > > > 2.21.0 > > > > > > > > Not the best approach to me... > > > Agreed, but this fix does seem reasonable since we already disable this > warning > for clang. > > > Let me install a fedora 30 and have a look. > Hopefully you can come up with a better fix, but I think we need somethin= g > soon for 19.05, so this patch may be needed as a stop-gap fix. > Hiding this warning, we will never fix the places that could be fixed (and I found some where the packed attribute makes no sense to me). I'd prefer at least a -Wno-error=3Daddress-of-packed-member --=20 David Marchand