[PATCH v4 0/6] use static assert to cathc build errors
Stephen Hemminger
stephen at networkplumber.org
Wed Jan 17 19:19:54 CET 2024
This series fixes a couple places where expressions that could not
be evaluated as constant early in compiler passes were used.
Then converts RTE_BUILD_BUG_ON() with static_assert.
static_assert() is more picky about the expression has to
be a constant, which also catches some existing undefined
behavior that pre-existed.
v4 - incorporate review feedback
add RTE_MIN_T and RTE_MAX_T macros
Stephen Hemminger (6):
eal: introduce RTE_MIN_T() and RTE_MAX_T() macros
event/opdl: fix non-constant compile time assertion
net/sfc: fix non-constant expression in RTE_BUILD_BUG_ON()
net/i40e: avoid using const variable in assertion
mempool: avoid floating point expression in static assertion
eal: replace out of bounds VLA with static_assert
drivers/event/opdl/opdl_ring.c | 2 +-
drivers/net/i40e/i40e_ethdev.h | 1 +
drivers/net/i40e/i40e_rxtx_vec_sse.c | 10 ++++------
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/sfc/sfc_ef100_tx.c | 4 +---
lib/eal/include/rte_common.h | 19 ++++++++++++++++++-
lib/mempool/rte_mempool.c | 7 ++++---
7 files changed, 30 insertions(+), 15 deletions(-)
--
2.43.0
More information about the dev
mailing list