Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
eal: replace out of bounds VLA with static_assert
Both Gcc, clang and MSVC have better way to do compile time assertions rather than using out of bounds array access. The old method would fail if -Wvla is enabled because compiler can't determine size in that code. Also, the use of new _Static_assert will catch broken code that is passing non-constant expression to RTE_BUILD_BUG_ON(). Need to add brackets {} around the static_assert() to workaround a bug in clang. Clang was not handling static_assert() in a switch case properly. Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Signed-off-by: 0-day Robot <robot@bytheb.org>
- Loading branch information