patches for DPDK stable branches
 help / color / mirror / Atom feed
From: Kevin Traynor <ktraynor@redhat.com>
To: stable@dpdk.org
Cc: bruce.richardson@intel.com, reshma.pattan@intel.com,
	David Marchand <david.marchand@redhat.com>
Subject: [dpdk-stable] [PATCH 18.11 1/3] mk: disable warning for packed member pointer
Date: Thu, 16 May 2019 19:21:55 +0100	[thread overview]
Message-ID: <20190516182157.32128-2-ktraynor@redhat.com> (raw)
In-Reply-To: <20190516182157.32128-1-ktraynor@redhat.com>

From: Reshma Pattan <reshma.pattan@intel.com>

[ upstream commit a385972c3675dd2b4792ab5b3cf7a536e6f9846c ]

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 ‘alloc_seg_walk’:
lib/librte_eal/linux/eal/eal_memalloc.c:768:12: error:
taking address of packed member of ‘struct rte_mem_config’ may result
in an unaligned pointer value [-Werror=address-of-packed-member]
  768 |  cur_msl = &mcfg->memsegs[msl_idx];
      |            ^~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Reshma Pattan <reshma.pattan@intel.com>
Tested-by: David Marchand <david.marchand@redhat.com>
---
 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
@@ -88,4 +88,7 @@ WERROR_FLAGS += -Wno-format-truncation
 endif
 
+# disable packed member unalign warnings
+WERROR_FLAGS += -Wno-address-of-packed-member
+
 export CC AS AR LD OBJCOPY OBJDUMP STRIP READELF
 export TOOLCHAIN_CFLAGS TOOLCHAIN_LDFLAGS TOOLCHAIN_ASFLAGS
-- 
2.20.1


  reply	other threads:[~2019-05-16 18:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16 18:21 [dpdk-stable] [PATCH 18.11 0/3] Fixes for GCC 9 Kevin Traynor
2019-05-16 18:21 ` Kevin Traynor [this message]
2019-05-16 18:21 ` [dpdk-stable] [PATCH 18.11 2/3] bus/fslmc: fix warning with " Kevin Traynor
2019-05-16 18:21 ` [dpdk-stable] [PATCH 18.11 3/3] mk: disable packed member pointer warning for telemetry Kevin Traynor
2019-05-17  8:39 ` [dpdk-stable] [PATCH 18.11 0/3] Fixes for GCC 9 Richardson, Bruce
2019-05-20 16:24   ` Kevin Traynor

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190516182157.32128-2-ktraynor@redhat.com \
    --to=ktraynor@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=reshma.pattan@intel.com \
    --cc=stable@dpdk.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).