Skip to content

Commit

Permalink
drivers: allow build with VLAs
Browse files Browse the repository at this point in the history
The drivers nfb, mvpp2 and mvsam use some variable length arrays
in their code, so the warnings about VLA must be disabled for now,
until removal for MSVC support, as in some other drivers.

The warnings look like below:

nfb_rx.h:156:16: error:
	ISO C90 forbids variable length array 'packets' [-Werror=vla]
  156 |         struct ndp_packet packets[nb_pkts];

mvpp2/mrvl_flow.c:108:9: error:
     ISO C90 forbids variable length array 'zeros' [-Werror=vla]
  108 |         uint8_t zeros[size];

mvsam/rte_mrvl_pmd.c:865:16: error:
	ISO C90 forbids variable length array 'requests_crp' [-Werror=vla]
  865 |         struct sam_cio_op_params requests_crp[nb_ops];

Fixes: 1bf8680 ("build: warn on uses of VLA")

Signed-off-by: Thomas Monjalon <[email protected]>
  • Loading branch information
tmonjalo committed Feb 8, 2025
1 parent 388b1ab commit 3553897
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/crypto/mvsam/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,6 @@ ext_deps += dep

sources = files('rte_mrvl_pmd.c', 'rte_mrvl_pmd_ops.c')

cflags += no_wvla_cflag

deps += ['bus_vdev', 'common_mvep', 'security']
2 changes: 2 additions & 0 deletions drivers/net/mvpp2/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@ sources = files(
'mrvl_tm.c',
)

cflags += no_wvla_cflag

deps += ['cfgfile', 'common_mvep']
2 changes: 2 additions & 0 deletions drivers/net/nfb/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ sources = files(
'nfb_stats.c',
'nfb_tx.c',
)

cflags += no_wvla_cflag

0 comments on commit 3553897

Please sign in to comment.