DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Michael Shamis <michaelsh@marvell.com>,
	Liron Himi <lironh@marvell.com>,
	Martin Spinler <spinler@cesnet.cz>,
	David Marchand <david.marchand@redhat.com>,
	Andre Muezerie <andremue@linux.microsoft.com>
Subject: [PATCH] drivers: allow build with VLAs
Date: Sat,  8 Feb 2025 10:28:38 +0100	[thread overview]
Message-ID: <20250208092839.1238770-1-thomas@monjalon.net> (raw)

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: 1bf86800f7da ("build: warn on uses of VLA")

Signed-off-by: Thomas Monjalon <thomas@monjalon.net>
---
 drivers/crypto/mvsam/meson.build | 2 ++
 drivers/net/mvpp2/meson.build    | 2 ++
 drivers/net/nfb/meson.build      | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/drivers/crypto/mvsam/meson.build b/drivers/crypto/mvsam/meson.build
index bf3c4323de..7fbdfb6ffe 100644
--- a/drivers/crypto/mvsam/meson.build
+++ b/drivers/crypto/mvsam/meson.build
@@ -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']
diff --git a/drivers/net/mvpp2/meson.build b/drivers/net/mvpp2/meson.build
index c7da8cd2e7..396e382128 100644
--- a/drivers/net/mvpp2/meson.build
+++ b/drivers/net/mvpp2/meson.build
@@ -26,4 +26,6 @@ sources = files(
         'mrvl_tm.c',
 )
 
+cflags += no_wvla_cflag
+
 deps += ['cfgfile', 'common_mvep']
diff --git a/drivers/net/nfb/meson.build b/drivers/net/nfb/meson.build
index bb5f66a09a..d7a255c928 100644
--- a/drivers/net/nfb/meson.build
+++ b/drivers/net/nfb/meson.build
@@ -21,3 +21,5 @@ sources = files(
         'nfb_stats.c',
         'nfb_tx.c',
 )
+
+cflags += no_wvla_cflag
-- 
2.47.1


                 reply	other threads:[~2025-02-08  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250208092839.1238770-1-thomas@monjalon.net \
    --to=thomas@monjalon.net \
    --cc=andremue@linux.microsoft.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=lironh@marvell.com \
    --cc=michaelsh@marvell.com \
    --cc=spinler@cesnet.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).