[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHmME9oukFd4=9J2AHOi3-4Axpw2M9-hwM6PSzRtvH_iCxaFaA@mail.gmail.com>
Date: Sat, 22 Nov 2025 03:46:38 +0100
From: "Jason A. Donenfeld" <Jason@...c4.com>
To: Herbert Xu <herbert@...dor.apana.org.au>
Cc: torvalds@...ux-foundation.org, ebiggers@...nel.org, ardb@...nel.org,
kees@...nel.org, linux-crypto@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH libcrypto v2 2/3] compiler: introduce at_least parameter
decoration pseudo keyword
On Sat, Nov 22, 2025 at 3:45 AM Herbert Xu <herbert@...dor.apana.org.au> wrote:
>
> Jason A. Donenfeld <Jason@...c4.com> wrote:
> >
> > +/*
> > + * This designates the minimum number of elements a passed array parameter must
> > + * have. For example:
> > + *
> > + * void some_function(u8 param[at_least 7]);
> > + *
> > + * If a caller passes an array with fewer than 7 elements, the compiler will
> > + * emit a warning.
> > + */
> > +#define at_least static
>
> Please make this conditional on __CHECKER__ as sparse still chokes
> on the following which compiles fine with gcc and clang:
>
> int foo(int n, int a[static n])
> {
> return a[0]++;
> }
Saw your reply to v1 and was thinking about that. Will do. Thanks for
pointing this out.
Jason
Powered by blists - more mailing lists