[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260122145556.7d72f217@pumpkin>
Date: Thu, 22 Jan 2026 14:55:56 +0000
From: David Laight <david.laight.linux@...il.com>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Cc: kernel test robot <lkp@...el.com>, Nathan Chancellor
<nathan@...nel.org>, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Thomas Gleixner <tglx@...utronix.de>, Peter Zijlstra
<peterz@...radead.org>, Ingo Molnar <mingo@...nel.org>, Mathieu Desnoyers
<mathieu.desnoyers@...icios.com>, Arnd Bergmann <arnd@...db.de>,
linux-arch@...r.kernel.org, linux-kernel@...r.kernel.org, Yury Norov
<yury.norov@...il.com>, Jani Nikula <jani.nikula@...el.com>, Vincent
Mailhol <mailhol.vincent@...adoo.fr>, Kees Cook <keescook@...omium.org>,
Andrew Morton <akpm@...ux-foundation.org>, oe-kbuild-all@...ts.linux.dev,
Linux Memory Management List <linux-mm@...ck.org>
Subject: Re: [PATCH next 11/14] bit: Strengthen compile-time tests in
GENMASK() and BIT()
On Thu, 22 Jan 2026 16:26:44 +0200
Andy Shevchenko <andriy.shevchenko@...ux.intel.com> wrote:
> On Thu, Jan 22, 2026 at 10:33:37AM +0000, David Laight wrote:
> > On Thu, 22 Jan 2026 12:41:22 +0800
> > kernel test robot <lkp@...el.com> wrote:
>
> > > sparse warnings: (new ones prefixed by >>)
> > > kernel/kthread.c: note: in included file (through include/linux/bitmap.h, include/linux/cpumask.h, arch/mips/include/asm/processor.h, ...):
> > > >> include/linux/find.h:209:45: sparse: sparse: Variable length array is used.
> >
> > Can we stop sparse complaining about sizeof(VLA) ?
>
> First of all, the LKP should install the fork of sparse by Al Viro. That will
> fix tons of warnings that are related to modules and speed up the process
> itself.
>
The problem I have is I want to generate a compile time error inside:
__builtin_choose_expr(__is_constexpr(x), x && error_a(),
statically_true(y) && error_b());
Neither static_assert() nor a negative bitfield can be used in error_a()
because they are errors when x isn't isn't a 'constexpr',
There is less of a problem for error_b() it can contain a function call,
but can't contain {( ...)}.
One of the compiler complained about sizeof (char [-!!(expr)]) as well.
I'm not sure of anything else that can be use to get an error.
I could use 0 >> -1 but that is only a warning, at least the error message
is related to the bug.
Any other ideas?
David
Powered by blists - more mailing lists