[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a23xv=FtTcpO=R-uDXJPor4sQ_MZr92oSXE4Ez6gpg03g@mail.gmail.com>
Date: Sun, 21 Nov 2021 14:18:09 +0100
From: Arnd Bergmann <arnd@...db.de>
To: Alexey Dobriyan <adobriyan@...il.com>
Cc: Alejandro Colomar <alx.manpages@...il.com>,
LKML <linux-kernel@...r.kernel.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Arnd Bergmann <arnd@...db.de>,
Jani Nikula <jani.nikula@...ux.intel.com>,
Rasmus Villemoes <linux@...musvillemoes.dk>,
Kees Cook <keescook@...omium.org>,
Joe Perches <joe@...ches.com>
Subject: Re: [PATCH v2 12/20] linux/must_be.h: Add must_be() to improve
readability of BUILD_BUG_ON_ZERO()
On Sat, Nov 20, 2021 at 4:05 PM Alexey Dobriyan <adobriyan@...il.com> 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
Powered by blists - more mailing lists