Skip to contentSkip to conversation

hash: replace zero length array

PATCH Applied Stephen Hemminger 4 participants 4 messages Aug 20, 2025 – Sep 26, 2025

lore
Share & tools
lore
#0 lore raw

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.

---
 lib/hash/rte_cuckoo_hash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/hash/rte_cuckoo_hash.h +1 -1
index 26a992419a..cf5cd29144 100644
@@ -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 on v1 1/1
#1 lore raw
Quoted 21 lines · Stephen Hemminger

Zero-length arrays are a GNU C extension and instead use the ISO C99 flexible array member.

---
 lib/hash/rte_cuckoo_hash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/hash/rte_cuckoo_hash.h +1 -1
index 26a992419a..cf5cd29144 100644
@@ -131,7 +131,7 @@ struct rte_hash_key {
 		RTE_ATOMIC(void *) pdata;
 	};
 	/* Variable key size */
-	char key[0];
+	char key[];
 };
 
 /** Bucket structure */
#2 lore raw
Quoted 26 lines

From: fengchengwen [mailto:[email protected]]
Sent: Thursday, 21 August 2025 02.43

Quoted 20 lines · Stephen Hemminger

Zero-length arrays are a GNU C extension and instead use the ISO C99 flexible array member.

---
 lib/hash/rte_cuckoo_hash.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/hash/rte_cuckoo_hash.h +1 -1
index 26a992419a..cf5cd29144 100644
@@ -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 */