Hi, Stephen

IIUC - for now all of the compilers claimed for DPDK compilation support the 
zero-length-array and we do not have an issue ?
We could eliminate this GNU extension and have workaround, like this:

/* Verbs headers do not support -pedantic. */
#ifdef PEDANTIC
#pragma GCC diagnostic ignored "-Wpedantic"
#endif
#include <infiniband/mlx5dv.h>
#include <infiniband/verbs.h>
#ifdef PEDANTIC
#pragma GCC diagnostic error "-Wpedantic"
#endif

I'm not sure this would make code more readable.
Should we do this WA?

With best regards,
Slava

> -----Original Message-----
> From: Stephen Hemminger <step...@networkplumber.org>
> Sent: суббота, 14 января 2023 г. 19:08
> To: dev@dpdk.org
> Cc: Matan Azrad <ma...@nvidia.com>; Slava Ovsiienko
> <viachesl...@nvidia.com>
> Subject: Re: [PATCH 4/7] mlx5: replace zero length array with flex array
> 
> On Fri, 13 Jan 2023 13:52:02 -0800
> Stephen Hemminger <step...@networkplumber.org> wrote:
> 
> > Zero length arrays are GNU extension. Replace with standard flex
> > array.
> >
> > Signed-off-by: Stephen Hemminger <step...@networkplumber.org>
> > ---
> 
> 
> Since Mlx driver enables pedantic checking, this causes build failure on some
> versions of gcc.
> 
> In file included from ../drivers/net/mlx5/mlx5.c:40:
> ../drivers/net/mlx5/mlx5_tx.h:187:23: error: invalid use of structure with
> flexible array member [-Werror=pedantic]
> 187 |  struct mlx5_txq_data txq; /* Data path structure. */
> |                       ^~~
> 
> 
> Understand that the driver wants to enable more checking since Nvidia does
> good job of keeping the code up to date. But having driver specific compiler
> flags like this creates more unnecessary complexity and doesn't improve the
> resulting code.

Reply via email to