Skip to contentSkip to conversation

mk: suppress reference of packed members

PATCH Superseded Emmanuel Roullit 2 participants 2 messages Jan 15, 2017 – Jan 16, 2017

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mk: suppress reference of packed members

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]

---
 mk/toolchain/clang/rte.vars.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mk/toolchain/clang/rte.vars.mk +1 -1
index 7749b99..04746be 100644
@@ -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
Signature · 1 line
1.9.1
#1 lore raw

Hi,

2017-01-15 20:47, Emmanuel Roullit:

Quoted 3 lines

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?

mk/toolchain/clang/rte.vars.mk WERROR_FLAGS := -W -Wall -Wstrict-prototypes -Wmissing-prototypes · line 70

Quoted 8 lines
mk/toolchain/clang/rte.vars.mk +1 -1
@@ -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?