[RFC] eal: use _Static_assert() for RTE_BUILD_BUG_ON

Tyler Retzlaff roretzla at linux.microsoft.com
Mon Nov 13 17:28:56 CET 2023


On Sat, Nov 11, 2023 at 09:21:53AM -0800, Stephen Hemminger wrote:
> The method of doing sizeof a bad array element was an interesting
> hack but it has a couple of problems. First, it won't work if
> VLA checking is enabled. It doesn't enforce that the expression
> is constant.
> 
> Replace that with the _Static_assert builtin available in
> Gcc, Clang, and MSVC.
> 
> Signed-off-by: Stephen Hemminger <stephen at networkplumber.org>
> ---

Acked-by: Tyler Retzlaff <roretzla at linux.microsoft.com>



More information about the dev mailing list