static_assert, sfc, and clang issues

Andrew Rybchenko andrew.rybchenko at oktetlabs.ru
Wed Jan 17 09:07:49 CET 2024


On 1/17/24 01:49, Stephen Hemminger wrote:
> 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.

I'm OK with the solution in the patch series. Thanks a lot.


More information about the dev mailing list