[PATCH] hash: replace zero length array

Morten Brørup mb at smartsharesystems.com
Thu Aug 21 03:43:36 CEST 2025


> From: fengchengwen [mailto:fengchengwen at huawei.com]
> Sent: Thursday, 21 August 2025 02.43
> 
> Acked-by: Chengwen Feng <fengchengwen at huawei.com>
> 
> On 8/21/2025 5:19 AM, Stephen Hemminger wrote:
> > Zero-length arrays are a GNU C extension and instead use the ISO C99
> > flexible array member.
> >
> > Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> > ---
> >  lib/hash/rte_cuckoo_hash.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/lib/hash/rte_cuckoo_hash.h b/lib/hash/rte_cuckoo_hash.h
> > index 26a992419a..cf5cd29144 100644
> > --- a/lib/hash/rte_cuckoo_hash.h
> > +++ b/lib/hash/rte_cuckoo_hash.h
> > @@ -131,7 +131,7 @@ struct rte_hash_key {
> >  		RTE_ATOMIC(void *) pdata;
> >  	};
> >  	/* Variable key size */
> > -	char key[0];
> > +	char key[];
> >  };
> >
> >  /** Bucket structure */

Acked-by: Morten Brørup <mb at smartsharesystems.com>



More information about the dev mailing list