eal: fix missing type in dtor macro expansion
Checks
Commit Message
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")
Cc: roretzla@linux.microsoft.com
Cc: stable@dpdk.org
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
lib/eal/include/rte_common.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
> From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com]
> 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.
>
> Fixes: 64eff943ca82 ("eal: implement constructors for MSVC")
> Cc: roretzla@linux.microsoft.com
> Cc: stable@dpdk.org
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> ---
Acked-by: Morten Brørup <mb@smartsharesystems.com>
@@ -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