[v5,3/6] fib: replace zero length array with flex array
Checks
Commit Message
Zero length arrays are GNU extension. Replace with
standard flex array.
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
Acked-by: Stephen Hemminger <stephen@networkplumber.org>
---
lib/fib/dir24_8.h | 2 +-
lib/fib/trie.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
Comments
Acked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>
On 06/03/2024 20:13, Tyler Retzlaff wrote:
> Zero length arrays are GNU extension. Replace with
> standard flex array.
>
> Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> lib/fib/dir24_8.h | 2 +-
> lib/fib/trie.h | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/lib/fib/dir24_8.h b/lib/fib/dir24_8.h
> index 6d350f7..7125049 100644
> --- a/lib/fib/dir24_8.h
> +++ b/lib/fib/dir24_8.h
> @@ -34,7 +34,7 @@ struct dir24_8_tbl {
> uint64_t *tbl8; /**< tbl8 table. */
> uint64_t *tbl8_idxes; /**< bitmap containing free tbl8 idxes*/
> /* tbl24 table. */
> - __extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[0];
> + alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[];
> };
>
> static inline void *
> diff --git a/lib/fib/trie.h b/lib/fib/trie.h
> index 36ce1fd..2c20184 100644
> --- a/lib/fib/trie.h
> +++ b/lib/fib/trie.h
> @@ -38,7 +38,7 @@ struct rte_trie_tbl {
> uint32_t *tbl8_pool; /**< bitmap containing free tbl8 idxes*/
> uint32_t tbl8_pool_pos;
> /* tbl24 table. */
> - __extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[0];
> + alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[];
> };
>
> static inline uint32_t
@@ -34,7 +34,7 @@ struct dir24_8_tbl {
uint64_t *tbl8; /**< tbl8 table. */
uint64_t *tbl8_idxes; /**< bitmap containing free tbl8 idxes*/
/* tbl24 table. */
- __extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[0];
+ alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[];
};
static inline void *
@@ -38,7 +38,7 @@ struct rte_trie_tbl {
uint32_t *tbl8_pool; /**< bitmap containing free tbl8 idxes*/
uint32_t tbl8_pool_pos;
/* tbl24 table. */
- __extension__ alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[0];
+ alignas(RTE_CACHE_LINE_SIZE) uint64_t tbl24[];
};
static inline uint32_t