hash: replace zero length array
PATCH 1/1 hash: replace zero length array
Zero-length arrays are a GNU C extension and instead use the ISO C99 flexible array member.
Signed-off-by Stephen Hemminger <[email protected]>
--- lib/hash/rte_cuckoo_hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/hash/rte_cuckoo_hash.h +1 -1
@@ -131,7 +131,7 @@ struct rte_hash_key {RTE_ATOMIC (void *) pdata; };/* Variable key size */ -char key[0 ]; +char key[]; };/** Bucket structure */
Signature · 1 line
2.47.2
Acked-by Chengwen Feng <[email protected]>
Quoted 21 lines · Stephen Hemminger
Zero-length arrays are a GNU C extension and instead use the ISO C99 flexible array member.
Signed-off-by Stephen Hemminger <[email protected]>--- lib/hash/rte_cuckoo_hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/hash/rte_cuckoo_hash.h +1
-1@@ -131,7 +131,7 @@ struct rte_hash_key {RTE_ATOMIC (void *) pdata; };/* Variable key size */ -char key[0 ]; +char key[]; };/** Bucket structure */
Morten Brørup
Acked-byQuoted 26 lines
From: fengchengwen [mailto:[email protected]]
Sent: Thursday, 21 August 2025 02.43Acked-by Chengwen Feng <[email protected]>Quoted 20 lines · Stephen Hemminger
Zero-length arrays are a GNU C extension and instead use the ISO C99 flexible array member.
Signed-off-by Stephen Hemminger <[email protected]>--- lib/hash/rte_cuckoo_hash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/hash/rte_cuckoo_hash.h +1
-1@@ -131,7 +131,7 @@ struct rte_hash_key {RTE_ATOMIC (void *) pdata; };/* Variable key size */ -char key[0 ]; +char key[]; };
Quoted 1 line
lib/hash/rte_cuckoo_hash.h struct rte_hash_key { · line 137
Quoted 1 line
lib/hash/rte_cuckoo_hash.h +0
-0/** Bucket structure */
Acked-by Morten Brørup <[email protected]>
Thomas Monjalon
AppliedQuoted 6 lines
Quoted 5 lines
Quoted 4 lines
Zero-length arrays are a GNU C extension and instead use the ISO C99 flexible array member.
Signed-off-by Stephen Hemminger <[email protected]>Acked-by Chengwen Feng <[email protected]>Acked-by Morten Brørup <[email protected]>
Applied, thanks.