Re: [PATCH v2 12/20] linux/must_be.h: Add must_be() to improve readability of BUILD_BUG_ON_ZERO()

From: Arnd Bergmann
Date: Sun Nov 21 2021 - 08:19:28 EST


On Sat, Nov 20, 2021 at 4:05 PM Alexey Dobriyan <adobriyan@xxxxxxxxx> wrote:
>
> On Sat, Nov 20, 2021 at 02:00:55PM +0100, Alejandro Colomar wrote:
> > Historically, BUILD_BUG_ON_ZERO() has been hard to read.
> > __must_be_array() is based on BUILD_BUG_ON_ZERO(),
> > and unlike BUILD_BUG_ON_*(),
> > it has a pretty readable name.
>
> The best name is assert() which userspace uses and is standartised.

I would argue that this macro is best left out: we have BUILD_BUG_ON()
as the interface that everyone knows, having another macro that has the
same results only makes things more confusing, and I would ask anyone
using it to use an open-coded BUILD_BUG_ON instead.

Arnd