Skip to contentSkip to conversation

eal: fix missing type in dtor macro expansion

PATCH Applied Tyler Retzlaff 3 participants 3 messages Apr 16, 2024 – May 16, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 eal: fix missing type in dtor macro expansion

RTE_FINI expansion failed to specify void * type for storage of destructor function pointer resulting it defaulting to type ``int``.

Update the macro to specify ``void *`` as the type so the correct size is allocated in the segment.

Fixes 64eff943ca82 ("eal: implement constructors for MSVC")
---
 lib/eal/include/rte_common.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/eal/include/rte_common.h +1 -1
index 298a5c6..618ed56 100644
@@ -291,7 +291,7 @@ static void __attribute__((destructor(RTE_PRIO(prio)), used)) func(void)
 #define RTE_FINI_PRIO(name, priority) \
 	static void name(void); \
 	__pragma(const_seg(DTOR_PRIORITY_TO_SECTION(priority))) \
-	__declspec(allocate(DTOR_PRIORITY_TO_SECTION(priority))) name ## _pointer = &name; \
+	__declspec(allocate(DTOR_PRIORITY_TO_SECTION(priority))) void *name ## _pointer = &name; \
 	__pragma(const_seg()) \
 	static void name(void)
 #endif
Signature · 1 line
1.8.3.1
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines

From: Tyler Retzlaff [mailto:[email protected]]
Sent: Tuesday, 16 April 2024 18.33

RTE_FINI expansion failed to specify void * type for storage of destructor function pointer resulting it defaulting to type ``int``.

Update the macro to specify ``void *`` as the type so the correct size is allocated in the segment.

Quoted 6 lines
Fixes 64eff943ca82 ("eal: implement constructors for MSVC")

---

#2 lore raw

16/04/2024 20:16, Morten Brørup:

Quoted 9 lines
Quoted 9 lines

From: Tyler Retzlaff [mailto:[email protected]]
Sent: Tuesday, 16 April 2024 18.33

RTE_FINI expansion failed to specify void * type for storage of destructor function pointer resulting it defaulting to type ``int``.

Update the macro to specify ``void *`` as the type so the correct size is allocated in the segment.

Quoted 7 lines
Quoted 5 lines
Fixes 64eff943ca82 ("eal: implement constructors for MSVC")

Applied, thanks.