DPDK patches and discussions
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: David Marchand <david.marchand@redhat.com>
Cc: dev <dev@dpdk.org>, "Morten Brørup" <mb@smartsharesystems.com>,
	"Stephen Hemminger" <stephen@networkplumber.org>
Subject: Re: [PATCH v2 2/4] drivers: replace zero-length arrays with undimensioned ones
Date: Fri, 3 Jun 2022 10:18:26 +0100	[thread overview]
Message-ID: <YpnR4pExsVQqeIpJ@bricha3-MOBL.ger.corp.intel.com> (raw)
In-Reply-To: <CAJFAV8wHOm-6F2ifwxnyxJVsOYeMtMOFGD977Y1NOBynDBT0Jg@mail.gmail.com>

On Fri, Jun 03, 2022 at 09:19:35AM +0200, David Marchand wrote:
> Hello Bruce,
> 
> On Thu, Jun 2, 2022 at 6:14 PM Bruce Richardson
> <bruce.richardson@intel.com> wrote:
> > diff --git a/drivers/common/mlx5/mlx5_prm.h b/drivers/common/mlx5/mlx5_prm.h
> > index bc3e70a1d1..ed0781a560 100644
> > --- a/drivers/common/mlx5/mlx5_prm.h
> > +++ b/drivers/common/mlx5/mlx5_prm.h
> > @@ -560,7 +560,7 @@ struct mlx5_umr_wqe {
> >  struct mlx5_rdma_write_wqe {
> >         struct mlx5_wqe_cseg ctr;
> >         struct mlx5_wqe_rseg rseg;
> > -       struct mlx5_wqe_dseg dseg[0];
> > +       struct mlx5_wqe_dseg dseg[];
> >  } __rte_packed;
> >
> >  #ifdef PEDANTIC
> > @@ -3479,7 +3479,7 @@ struct mlx5_ifc_qpc_pas_list_bits {
> >  #endif
> >  struct mlx5_ifc_qpc_extension_and_pas_list_bits {
> >         struct mlx5_ifc_qpc_extension_bits qpc_data_extension;
> > -       u8 pas[0][0x40];
> > +       u8[0x40] pas[];
> 
> Gcc and clang seem to agree they disagree with coccinelle.
> clang suggests using u8 pas[][0x40].
> 

Changing this as suggested gives further errors in builds (now that I have
the correct dependencies for the mlx5 driver installed on my system!)

In file included from ../../drivers/net/mlx5/mlx5_tx_empw.c:6:
../../drivers/net/mlx5/mlx5_tx.h:187:30: error: invalid use of structure with flexible array member [-Werror=pedantic]
  187 |         struct mlx5_txq_data txq; /* Data path structure. */
      |                              ^~~
cc1: all warnings being treated as errors

Therefore, I'll just drop the cleanup of these structures from V3.

/Bruce

  parent reply	other threads:[~2022-06-03  9:18 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-02 15:08 [PATCH 0/4] clean up zero-length arrays Bruce Richardson
2022-06-02 15:08 ` [PATCH 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-02 15:08 ` [PATCH 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-02 15:08 ` [PATCH 3/4] lib: " Bruce Richardson
2022-06-02 15:08 ` [PATCH 4/4] app: examples: " Bruce Richardson
2022-06-02 15:20 ` [PATCH 0/4] clean up zero-length arrays Morten Brørup
2022-06-02 15:35 ` Stephen Hemminger
2022-06-02 16:13 ` [PATCH v2 " Bruce Richardson
2022-06-02 16:13   ` [PATCH v2 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-02 16:13   ` [PATCH v2 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-03  7:19     ` David Marchand
2022-06-03  7:36       ` Bruce Richardson
2022-06-03  9:18       ` Bruce Richardson [this message]
2022-06-02 16:13   ` [PATCH v2 3/4] lib: " Bruce Richardson
2022-06-02 16:13   ` [PATCH v2 4/4] app: examples: " Bruce Richardson
2022-06-03  6:56   ` [PATCH v2 0/4] clean up zero-length arrays Hemant Agrawal
2022-06-03 10:13 ` [PATCH v3 " Bruce Richardson
2022-06-03 10:13   ` [PATCH v3 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-03 10:30     ` Morten Brørup
2022-06-03 10:38       ` Bruce Richardson
2022-06-03 10:13   ` [PATCH v3 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-03 10:13   ` [PATCH v3 3/4] lib: " Bruce Richardson
2022-06-03 10:13   ` [PATCH v3 4/4] app: examples: " Bruce Richardson
2022-06-03 11:13   ` [PATCH v3 0/4] clean up zero-length arrays Bruce Richardson
2022-06-03 11:16 ` [PATCH v4 " Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 1/4] cocci: add script for zero-length arrays in structs Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 2/4] drivers: replace zero-length arrays with undimensioned ones Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 3/4] lib: " Bruce Richardson
2022-06-03 11:16   ` [PATCH v4 4/4] app: examples: " Bruce Richardson
2022-06-07 14:16   ` [PATCH v4 0/4] clean up zero-length arrays David Marchand
2022-06-09 15:19   ` Tyler Retzlaff
2022-06-08 15:23 ` [PATCH " Stephen Hemminger
2022-06-14  9:40   ` Bruce Richardson
2022-06-14  9:45     ` Bruce Richardson

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=YpnR4pExsVQqeIpJ@bricha3-MOBL.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=stephen@networkplumber.org \
    /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).