[dpdk-dev] mk: suppress reference of packed members

Message ID 1484509675-15075-1-git-send-email-emmanuel.roullit@gmail.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel compilation success Compilation OK

Commit Message

Emmanuel Roullit Jan. 15, 2017, 7:47 p.m. UTC
  error: taking address of packed member 'mlock' of class or structure
'rte_mem_config' may result in an unaligned pointer value
[-Werror,-Waddress-of-packed-member]

Signed-off-by: Emmanuel Roullit <emmanuel.roullit@gmail.com>
---
 mk/toolchain/clang/rte.vars.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Thomas Monjalon Jan. 16, 2017, 3:33 p.m. UTC | #1
Hi,

2017-01-15 20:47, Emmanuel Roullit:
> error: taking address of packed member 'mlock' of class or structure
> 'rte_mem_config' may result in an unaligned pointer value
> [-Werror,-Waddress-of-packed-member]

Is it a compilation error?
Which compiler version?

> --- a/mk/toolchain/clang/rte.vars.mk
> +++ b/mk/toolchain/clang/rte.vars.mk
> @@ -67,7 +67,7 @@ WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
>  WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
>  WERROR_FLAGS += -Wnested-externs -Wcast-qual
>  WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
> -WERROR_FLAGS += -Wundef -Wwrite-strings
> +WERROR_FLAGS += -Wundef -Wwrite-strings -Wno-address-of-packed-member

Why removing the warning?
Is there something to fix in the code?
  

Patch

diff --git a/mk/toolchain/clang/rte.vars.mk b/mk/toolchain/clang/rte.vars.mk
index 7749b99..04746be 100644
--- a/mk/toolchain/clang/rte.vars.mk
+++ b/mk/toolchain/clang/rte.vars.mk
@@ -67,7 +67,7 @@  WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes
 WERROR_FLAGS += -Wmissing-declarations -Wold-style-definition -Wpointer-arith
 WERROR_FLAGS += -Wnested-externs -Wcast-qual
 WERROR_FLAGS += -Wformat-nonliteral -Wformat-security
-WERROR_FLAGS += -Wundef -Wwrite-strings
+WERROR_FLAGS += -Wundef -Wwrite-strings -Wno-address-of-packed-member
 
 ifeq ($(RTE_DEVEL_BUILD),y)
 WERROR_FLAGS += -Werror