[v3,10/19] lpm: remove use of VLAs for Windows built code
Checks
Commit Message
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@linux.microsoft.com>
---
lib/lpm/rte_lpm.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -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. */