[v2,3/4] fib: replace zero length array with flex array

Message ID 1707777366-26000-4-git-send-email-roretzla@linux.microsoft.com (mailing list archive)
State Changes Requested
Delegated to: Thomas Monjalon
Headers
Series more replacement of zero length array |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Tyler Retzlaff Feb. 12, 2024, 10:36 p.m. UTC
  Zero length arrays are GNU extension. Replace with
standard flex array.

Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
---
 lib/fib/dir24_8.h | 2 +-
 lib/fib/trie.h    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
  

Patch

diff --git a/lib/fib/dir24_8.h b/lib/fib/dir24_8.h
index b0d1a40..5a7b6dd 100644
--- a/lib/fib/dir24_8.h
+++ b/lib/fib/dir24_8.h
@@ -32,7 +32,7 @@  struct dir24_8_tbl {
 	uint64_t	*tbl8;		/**< tbl8 table. */
 	uint64_t	*tbl8_idxes;	/**< bitmap containing free tbl8 idxes*/
 	/* tbl24 table. */
-	__extension__ uint64_t	tbl24[0] __rte_cache_aligned;
+	uint64_t	tbl24[] __rte_cache_aligned;
 };
 
 static inline void *
diff --git a/lib/fib/trie.h b/lib/fib/trie.h
index 3cf161a..71ed191 100644
--- a/lib/fib/trie.h
+++ b/lib/fib/trie.h
@@ -36,7 +36,7 @@  struct rte_trie_tbl {
 	uint32_t	*tbl8_pool;	/**< bitmap containing free tbl8 idxes*/
 	uint32_t	tbl8_pool_pos;
 	/* tbl24 table. */
-	__extension__ uint64_t	tbl24[0] __rte_cache_aligned;
+	uint64_t	tbl24[] __rte_cache_aligned;
 };
 
 static inline uint32_t