[PATCH 4/7] mlx5: replace zero length array with flex array
Stephen Hemminger
stephen at networkplumber.org
Sat Jan 14 18:08:25 CET 2023
On Fri, 13 Jan 2023 13:52:02 -0800
Stephen Hemminger <stephen at networkplumber.org> wrote:
> Zero length arrays are GNU extension. Replace with
> standard flex array.
>
> Signed-off-by: Stephen Hemminger <stephen at 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.
More information about the dev
mailing list