[v3,0/5] use static_assert to catch build errors

Message ID 20240116184307.162882-1-stephen@networkplumber.org (mailing list archive)
Headers
Series use static_assert to catch build errors |

Message

Stephen Hemminger Jan. 16, 2024, 6:41 p.m. UTC
  This series fixes a couple places where expressions that could not
be evaluated as constant early in compiler passes were used. And 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.

Stephen Hemminger (5):
  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       |  5 ++++-
 drivers/net/i40e/i40e_ethdev.h       |  1 +
 drivers/net/i40e/i40e_rxtx_vec_sse.c | 10 ++++------
 drivers/net/sfc/sfc_ef100_tx.c       |  7 +++++--
 lib/eal/include/rte_common.h         |  3 ++-
 lib/mempool/rte_mempool.c            |  4 +---
 6 files changed, 17 insertions(+), 13 deletions(-)