From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-vk1-f196.google.com (mail-vk1-f196.google.com [209.85.221.196]) by dpdk.org (Postfix) with ESMTP id 43CC62C55 for ; Thu, 2 May 2019 12:07:29 +0200 (CEST) Received: by mail-vk1-f196.google.com with SMTP id t74so401827vke.2 for ; Thu, 02 May 2019 03:07:29 -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=6fbqXj8b9efmEWuBGoAL5jHFUsPBxDOMj6DzMT1U1mI=; b=F3LMx/Y1yEUgKk0gfuJbEbrFmA5XiKC37bt6tbHqJpk1ThZJoaYXuaKBYUa+h2kmWW PxPuUNjZh5VXVQBiUZaNugy8BZ7gzL5eBlmHCvyBV/Nz2VhRZkiGy+6fBOThkk5Rg25A n71M8CCEniBupa7BF5ZV35avsd1B6k4iYtXUBkWL1D4k34JSZzNVqTVxrvEzszyqI3B+ u4vFqdItWElN5u1GBRQ1wasipDPuQBAETVbAhk9SrdtggxrZRzDL9daM5UxKfG5fPB+b /FqBe0GjKU41Ghu1Rbdi88xae2aIY9iDtMNh1TBpYYI4RPjqDqe6hmE2VarR/k8EfEBU UQ1g== X-Gm-Message-State: APjAAAVQHbVVaHvy2NQg/yyHfNkEvJnm6IBJq7NGMF+O7COScUhUonbE em8eONtDT9ivf5IUl+rmijUZsavdxh9GDF15rmRt1g== X-Google-Smtp-Source: APXvYqzAFfUs1DDkAx6Egpdq1Zr6+S/YfqM4liUZnGY22DEjpRFLavTHsyjquFmFP+Cm6mk0VPwv1QEi2Q7PIMTubws= X-Received: by 2002:a1f:c446:: with SMTP id u67mr1278834vkf.52.1556791648564; Thu, 02 May 2019 03:07:28 -0700 (PDT) MIME-Version: 1.0 References: <20190502093334.7546-1-reshma.pattan@intel.com> In-Reply-To: <20190502093334.7546-1-reshma.pattan@intel.com> From: David Marchand Date: Thu, 2 May 2019 12:07:17 +0200 Message-ID: To: Reshma Pattan Cc: 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: , X-List-Received-Date: Thu, 02 May 2019 10:07:29 -0000 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_se= g_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 result 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... Let me install a fedora 30 and have a look. --=20 David Marchand 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 4A63FA0AC5 for ; Thu, 2 May 2019 12:07:32 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4660A2C6A; Thu, 2 May 2019 12:07:31 +0200 (CEST) Received: from mail-vk1-f196.google.com (mail-vk1-f196.google.com [209.85.221.196]) by dpdk.org (Postfix) with ESMTP id 43CC62C55 for ; Thu, 2 May 2019 12:07:29 +0200 (CEST) Received: by mail-vk1-f196.google.com with SMTP id t74so401827vke.2 for ; Thu, 02 May 2019 03:07:29 -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=6fbqXj8b9efmEWuBGoAL5jHFUsPBxDOMj6DzMT1U1mI=; b=F3LMx/Y1yEUgKk0gfuJbEbrFmA5XiKC37bt6tbHqJpk1ThZJoaYXuaKBYUa+h2kmWW PxPuUNjZh5VXVQBiUZaNugy8BZ7gzL5eBlmHCvyBV/Nz2VhRZkiGy+6fBOThkk5Rg25A n71M8CCEniBupa7BF5ZV35avsd1B6k4iYtXUBkWL1D4k34JSZzNVqTVxrvEzszyqI3B+ u4vFqdItWElN5u1GBRQ1wasipDPuQBAETVbAhk9SrdtggxrZRzDL9daM5UxKfG5fPB+b /FqBe0GjKU41Ghu1Rbdi88xae2aIY9iDtMNh1TBpYYI4RPjqDqe6hmE2VarR/k8EfEBU UQ1g== X-Gm-Message-State: APjAAAVQHbVVaHvy2NQg/yyHfNkEvJnm6IBJq7NGMF+O7COScUhUonbE em8eONtDT9ivf5IUl+rmijUZsavdxh9GDF15rmRt1g== X-Google-Smtp-Source: APXvYqzAFfUs1DDkAx6Egpdq1Zr6+S/YfqM4liUZnGY22DEjpRFLavTHsyjquFmFP+Cm6mk0VPwv1QEi2Q7PIMTubws= X-Received: by 2002:a1f:c446:: with SMTP id u67mr1278834vkf.52.1556791648564; Thu, 02 May 2019 03:07:28 -0700 (PDT) MIME-Version: 1.0 References: <20190502093334.7546-1-reshma.pattan@intel.com> In-Reply-To: <20190502093334.7546-1-reshma.pattan@intel.com> From: David Marchand Date: Thu, 2 May 2019 12:07:17 +0200 Message-ID: To: Reshma Pattan Cc: 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: <20190502100717.vdIACW_juLDE97N-c4ZheyTIkAm5OsamJfPKs_MbqX0@z> 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_se= g_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 result 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... Let me install a fedora 30 and have a look. --=20 David Marchand