Re: [PATCH v5 6/6] eal: replace out of bounds VLA with static_assert

2024-01-19 Thread Ferruh Yigit
On 1/18/2024 6:42 PM, Morten Brørup wrote: >> From: Stephen Hemminger [mailto:step...@networkplumber.org] >> Sent: Thursday, 18 January 2024 17.51 >> >> 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 fa

RE: [PATCH v5 6/6] eal: replace out of bounds VLA with static_assert

2024-01-18 Thread Morten Brørup
> From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Thursday, 18 January 2024 17.51 > > 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

[PATCH v5 6/6] eal: replace out of bounds VLA with static_assert

2024-01-18 Thread Stephen Hemminger
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-cons