On Wed, 22 Nov 2023 07:23:36 +0000
Hemant Agrawal <hemant.agra...@nxp.com> wrote:

> > -----Original Message-----
> > From: Tyler Retzlaff <roret...@linux.microsoft.com>
> > Sent: Tuesday, November 21, 2023 10:49 PM
> > To: Stephen Hemminger <step...@networkplumber.org>
> > Cc: Hemant Agrawal <hemant.agra...@nxp.com>; dev@dpdk.org; Sachin
> > Saxena <sachin.sax...@nxp.com>; Gagandeep Singh <g.si...@nxp.com>
> > Subject: Re: [PATCH v4 10/10] common/dpaxx: remove zero length array
> > Importance: High
> > 
> > On Tue, Nov 21, 2023 at 08:46:41AM -0800, Stephen Hemminger wrote:  
> > > On Tue, 21 Nov 2023 10:49:59 +0000
> > > Hemant Agrawal <hemant.agra...@nxp.com> wrote:
> > >  
> > > > >  struct ipsec_encap_pdb {
> > > > >       uint32_t options;
> > > > > @@ -350,7 +349,6 @@ struct ipsec_encap_pdb {
> > > > >       };
> > > > >       uint32_t spi;
> > > > >       uint32_t ip_hdr_len;
> > > > > -     uint8_t ip_hdr[0];  
> > > > [Hemant] This should be replaced with
> > > >         uint8_t ip_hdr[];  
> > > > >  };
> > > > >  
> > >
> > > That won't work because the structure is embedded in another struct
> > > and then clang will correctly report an error.  
> > 
> > Hemant if the field is not referenced what's the harm in removing it?  
> 
> It is being used indirectly, e.g. dpaa_sec.h usages it for ip address 
> description preparation for the hardware.
> 
>             struct ipsec_encap_pdb encap_pdb;
>             union {
>                 struct ip ip4_hdr;
>                 struct rte_ipv6_hdr ip6_hdr;
>             };
> 
> We need to change it, however in the interim, I will like to add 
> "-Wno-gnu-variable-sized-type-not-at-end" for both caam_jr and dpaa_sec to 
> avoid this warning.

Ok, there are several ways to fix that. Driver specific compiler flags are the 
one
that is least favored. 

Reply via email to