On Thu, May 29, 2025 at 5:42 AM Andre Muezerie <andre...@linux.microsoft.com> wrote: > > With gcc, the macro __rte_used translates to __attribute__((used)). > MSVC has something to the same effect, but harder to use and with some > limitations (one being that it cannot be used with "static"). Therefore, > it makes sense to avoid __rte_used in some cases. > > The functions modified in this patch don't really need to use __rte_used. > Instead, these functions can be involved in same ifdefs used in the > callers. That way, they are only defined when needed (when > someone is actually calling the function). Doing so makes the code > compatible with MSVC and avoids compiler warnings about functions being > defined but not used. > > Signed-off-by: Andre Muezerie <andre...@linux.microsoft.com> > Acked-by: Pavan Nikhilesh <pbhagavat...@marvell.com>
Updated the git commit as follows and applied to dpdk-next-net-mrvl/for-main. Thanks net/cnxk: improve MSVC compatibility With gcc, the macro __rte_used translates to __attribute__((used)). MSVC has something to the same effect, but harder to use and with some limitations (one being that it cannot be used with "static"). Therefore, it makes sense to avoid __rte_used in some cases. The functions modified in this patch don't really need to use __rte_used. Instead, these functions can be involved in same ifdefs used in the callers. That way, they are only defined when needed (when someone is actually calling the function). Doing so makes the code compatible with MSVC and avoids compiler warnings about functions being defined but not used. Signed-off-by: Andre Muezerie <andre...@linux.microsoft.com> Acked-by: Pavan Nikhilesh <pbhagavat...@marvell.com>