Skip to contentSkip to conversation

eal: ignore alignment warnings for x86

PATCH Superseded Haiyue Wang 2 participants 5 messages Apr 29, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: ignore alignment warnings for x86

There several alignment warnings when including rte_memcpy header file externally like OVS for x86.

---
 lib/librte_eal/x86/include/rte_memcpy.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_eal/x86/include/rte_memcpy.h +4 -0
index ba44c4a32..6f5e0feb4 100644
@@ -22,6 +22,10 @@
 extern "C" {
 #endif
 
+#ifndef __INTEL_COMPILER
+#pragma GCC diagnostic ignored "-Wcast-align"
+#endif
+
 /**
  * Copy bytes from one location to another. The locations must not overlap.
  *
Signature · 1 line
2.26.2
#1 lore raw

PATCH v2 1/1 eal: ignore alignment warnings for x86 vector

There several alignment warnings when including rte_memcpy header file externally like OVS for x86.

---
v2: Use __GUNC__ macro to apply for suppressing the warning.

---
 lib/librte_eal/x86/include/rte_memcpy.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_eal/x86/include/rte_memcpy.h +4 -0
index ba44c4a32..d4cfe8dd5 100644
@@ -22,6 +22,10 @@
 extern "C" {
 #endif
 
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wcast-align"
+#endif
+
 /**
  * Copy bytes from one location to another. The locations must not overlap.
  *
Signature · 1 line
2.26.2
#2 lore raw

Re: [dpdk-dev] [PATCH v2] eal: ignore alignment warnings for x86 vector

Dropped this patch, it is better to let the application to decide the warning level.

BR,
Haiyue

Quoted 35 lines

-----Original Message-----
From: Wang, Haiyue <[email protected]>
Sent: Wednesday, April 29, 2020 14:49
To: [email protected]; Richardson, Bruce <[email protected]>; Ananyev, Konstantin <[email protected]>; Stokes, Ian <[email protected]>
Cc: Wang, Haiyue <[email protected]>
Subject: [PATCH v2] eal: ignore alignment warnings for x86 vector

There several alignment warnings when including rte_memcpy header file externally like OVS for x86.

---
v2: Use __GUNC__ macro to apply for suppressing the warning.

---
 lib/librte_eal/x86/include/rte_memcpy.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_eal/x86/include/rte_memcpy.h +4 -1
index ba44c4a32..d4cfe8dd5 100644
@@ -22,6 +22,10 @@
 extern "C" {
 #endif
 
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wcast-align"
+#endif
+
 /**
  * Copy bytes from one location to another. The locations must not overlap.
  *
--

2.26.2

#3 lore raw

Re: [dpdk-dev] [PATCH v2] eal: ignore alignment warnings for x86 vector

In reply to Haiyue Wang
Quoted 15 lines · Haiyue Wang

There several alignment warnings when including rte_memcpy header file externally like OVS for x86.

---
v2: Use __GUNC__ macro to apply for suppressing the warning.

---
 lib/librte_eal/x86/include/rte_memcpy.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_eal/x86/include/rte_memcpy.h +0 -0
index ba44c4a32..d4cfe8dd5 100644

lib/librte_eal/x86/include/rte_memcpy.h line 28

Quoted 7 lines
lib/librte_eal/x86/include/rte_memcpy.h +4 -0
@@ -22,6 +22,10 @@
 extern "C" {
 #endif
 
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wcast-align"
+#endif
+

Hi - have a look at this thread and the comments about a similar topic, they are relevant here too.
http://inbox.dpdk.org/dev/[email protected]/

Quoted 4 lines
lib/librte_eal/x86/include/rte_memcpy.h +0 -0
 /**
  * Copy bytes from one location to another. The locations must not overlap.
  *
#4 lore raw

Re: [dpdk-dev] [PATCH v2] eal: ignore alignment warnings for x86 vector

Quoted 26 lines

-----Original Message-----
From: Kevin Traynor <[email protected]>
Sent: Wednesday, April 29, 2020 16:41
To: Wang, Haiyue <[email protected]>; [email protected]; Richardson, Bruce <[email protected]>; Ananyev, Konstantin <[email protected]>; Stokes, Ian <[email protected]>
Subject: Re: [dpdk-dev] [PATCH v2] eal: ignore alignment warnings for x86 vector

Quoted 18 lines · Haiyue Wang

There several alignment warnings when including rte_memcpy header file externally like OVS for x86.

---
v2: Use __GUNC__ macro to apply for suppressing the warning.

---
 lib/librte_eal/x86/include/rte_memcpy.h | 4 ++++
 1 file changed, 4 insertions(+)
lib/librte_eal/x86/include/rte_memcpy.h +0 -0
index ba44c4a32..d4cfe8dd5 100644
@@ -22,6 +22,10 @@
 extern "C" {
 #endif
 
Quoted 9 lines

lib/librte_eal/x86/include/rte_memcpy.h line 28

Quoted 4 lines
lib/librte_eal/x86/include/rte_memcpy.h +4 -0
+#ifdef __GNUC__
+#pragma GCC diagnostic ignored "-Wcast-align"
+#endif
+

Hi - have a look at this thread and the comments about a similar topic, they are relevant here too.
http://inbox.dpdk.org/dev/[email protected]/

This issue happened on GCC 9.3.0 and build DPDK successfully, but compiling the OVS-DPDK has lot of warnings. Do we need to fix this ?

Quoted 4 lines
Quoted 4 lines
lib/librte_eal/x86/include/rte_memcpy.h +0 -0
 /**
  * Copy bytes from one location to another. The locations must not overlap.
  *