[PATCH 06/16] lpm: remove use of VLAs for Windows built code
Tyler Retzlaff
roretzla at linux.microsoft.com
Thu Apr 18 01:41:49 CEST 2024
MSVC does not support VLAs, replace VLAs with standard C arrays
or alloca(). alloca() is available for all toolchain/platform
combinations officially supported by DPDK.
Signed-off-by: Tyler Retzlaff <roretzla at linux.microsoft.com>
---
lib/lpm/rte_lpm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/lpm/rte_lpm.h b/lib/lpm/rte_lpm.h
index 2888e5f..fc5805c 100644
--- a/lib/lpm/rte_lpm.h
+++ b/lib/lpm/rte_lpm.h
@@ -337,7 +337,7 @@ struct rte_lpm *
uint32_t *next_hops, const unsigned n)
{
unsigned i;
- unsigned tbl24_indexes[n];
+ unsigned int *tbl24_indexes = (unsigned int *)alloca(sizeof(unsigned int) * n);
const uint32_t *ptbl;
/* DEBUG: Check user input arguments. */
--
1.8.3.1
More information about the dev
mailing list