On Sat, 11 Nov 2023 08:56:34 -0800
Stephen Hemminger <step...@networkplumber.org> wrote:

> While examining the use of VLA in DPDK, ran into a bug in sfc driver.
> 
> If DPDK is built with -Wvla, then the RTE_BUILD_BUG_ON() macro won't work
> as written. Experimenting with a better more portable version of that macro
> as:
>       #define RTE_BUILD_BUG_ON(e) _Static_assert(!(e),  #e)

Sending this as RFC also catches another driver with hidden failure.

from ../drivers/event/opdl/opdl_ring.c:10:
./drivers/event/opdl/opdl_ring.c: In function ‘opdl_ring_create’:
./lib/eal/include/rte_common.h:498:44: error: expression in static assertion is 
not constant
#define RTE_BUILD_BUG_ON(e) _Static_assert(!(e), #e)
^~~~
./drivers/event/opdl/opdl_ring.c:913:2: note: in expansion of macro 
‘RTE_BUILD_BUG_ON’
RTE_BUILD_BUG_ON(!rte_is_power_of_2(OPDL_DISCLAIMS_PER_LCORE));

Reply via email to