Skip to content

use static_assert for build error reports

Stephen Hemminger dpdk-dev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest6 patches 6 repliesIn review
  2. v46 patches 11 repliesSuperseded

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6eal: introduce RTE_MIN_T() and RTE_MAX_T() macroslib/eal/include/rte_common.h+16 -01 reply
2/6event/opdl: fix non-constant compile time assertiondrivers/event/opdl/opdl_ring.c+1 -10 replies
3/6net/sfc: fix non-constant expression in RTE_BUILD_BUG_ON()drivers/net/sfc/sfc_ef100_tx.c+1 -20 replies
4/6net/i40e: avoid using const variable in assertiondrivers/net/i40e/i40e_ethdev.h drivers/net/i40e/i40e_rxtx_vec_sse.c+5 -60 replies
5/6mempool: avoid floating point expression in static assertiondrivers/net/mlx5/mlx5_rxq.c lib/mempool/rte_mempool.c+5 -42 replies
6/6eal: replace out of bounds VLA with static_assertlib/eal/include/rte_common.h+10 -12 replies

Reviews trailers per patch

All 6 patches have a Reviewed-by or Acked-by.

PatchKonstantin AnanyevAndrew RybchenkoBruce RichardsonTyler RetzlaffMorten BrørupChengwen FengViacheslav OvsiienkoFerruh Yigit
1/6A-b A-b A-b
2/6A-b A-b A-b
3/6R-b A-b
4/6A-b A-b
5/6A-b R-b R-b A-b
6/6A-b A-b R-b A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 8 reviewers.

Read the v5 thread

Cover letter [PATCH v5 0/6] use static_assert for build error reports

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.

The series requires a couple of workarounds to deal with quirks in static_assert() in some toolchains.

v6 - minor cleanups
handle missing macro in old FreeBSD

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       |  3 +--
 lib/eal/include/rte_common.h         | 27 ++++++++++++++++++++++++++-
 lib/mempool/rte_mempool.c            |  7 ++++---
 7 files changed, 38 insertions(+), 14 deletions(-)
Signature · 1 line
2.43.0