static_assert, sfc, and clang issues

Stephen Hemminger stephen at networkplumber.org
Tue Jan 16 23:49:52 CET 2024


On Tue, 16 Jan 2024 23:14:36 +0100
Morten Brørup <mb at smartsharesystems.com> wrote:

> > +1 for #2 just make it a block.  
> 
> I prefer that you implement the workaround in the RTE_BUILD_BUG_ON() macro, by surrounding it by "do { } while (0)", like this:
> 
> #define RTE_BUILD_BUG_ON(condition) do { static_assert(!(condition), #condition); } while (0)
> 
> And please mention the workaround reason, with the reference to the clang bug, in the source code comment describing the function.
> 
> The godbolt link in the clang issue seems happy with this workaround.

In the patch series sent, already did that. Didn't need to do { } while(0) hack to make it work.
Reference is in commit message.


More information about the dev mailing list