[2/2] eal: remove typeof from per lcore macros

Message ID 1703006864-27378-3-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series remove __typeof__ from expansion of per lcore macros |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/loongarch-compilation success Compilation OK
ci/loongarch-unit-testing success Unit Testing PASS
ci/Intel-compilation fail Compilation issues
ci/github-robot: build success github build: passed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-abi-testing success Testing PASS
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-unit-amd64-testing fail Testing issues
ci/iol-unit-arm64-testing warning Testing issues
ci/iol-sample-apps-testing warning Testing issues
ci/iol-compile-amd64-testing success Testing PASS
ci/iol-compile-arm64-testing success Testing PASS

Commit Message

Tyler Retzlaff Dec. 19, 2023, 5:27 p.m. UTC
  The design of the macros requires a type to be provided to the macro.

By expanding the type parameter inside of typeof it also inadvertently
allows an expression to be used which appears not to have been intended
after evaluating the parameter name and existing macro use.

Technically this is an API break but only for applications that were
using these macros outside of the original design intent.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/eal/include/rte_per_lcore.h | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
  

Patch

diff --git a/lib/eal/include/rte_per_lcore.h b/lib/eal/include/rte_per_lcore.h
index 41fe1f0..529995e 100644
--- a/lib/eal/include/rte_per_lcore.h
+++ b/lib/eal/include/rte_per_lcore.h
@@ -24,10 +24,10 @@ 
 
 #ifdef RTE_TOOLCHAIN_MSVC
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__declspec(thread) typeof(type) per_lcore_##name
+	__declspec(thread) type per_lcore_##name
 
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __declspec(thread) typeof(type) per_lcore_##name
+	extern __declspec(thread) type per_lcore_##name
 #else
 /**
  * Macro to define a per lcore variable "var" of type "type", don't
@@ -35,13 +35,13 @@ 
  * whole macro.
  */
 #define RTE_DEFINE_PER_LCORE(type, name)			\
-	__thread __typeof__(type) per_lcore_##name
+	__thread type per_lcore_##name
 
 /**
  * Macro to declare an extern per lcore variable "var" of type "type"
  */
 #define RTE_DECLARE_PER_LCORE(type, name)			\
-	extern __thread __typeof__(type) per_lcore_##name
+	extern __thread type per_lcore_##name
 #endif
 
 /**