public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Herbert Xu <herbert@gondor.apana.org.au>
To: "Jason A. Donenfeld" <Jason@zx2c4.com>
Cc: torvalds@linux-foundation.org, ebiggers@kernel.org,
	ardb@kernel.org, kees@kernel.org, linux-crypto@vger.kernel.org,
	linux-kernel@vger.kernel.org, Jason@zx2c4.com
Subject: Re: [PATCH libcrypto v2 2/3] compiler: introduce at_least parameter decoration pseudo keyword
Date: Sat, 22 Nov 2025 10:45:36 +0800	[thread overview]
Message-ID: <aSEj0GvbFjwlDbVM@gondor.apana.org.au> (raw)
In-Reply-To: <20251120011022.1558674-2-Jason@zx2c4.com>

Jason A. Donenfeld <Jason@zx2c4.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]++;
}

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

  parent reply	other threads:[~2025-11-22  2:45 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-20  1:10 [PATCH libcrypto v2 1/3] wifi: iwlwifi: trans: rename at_least variable to min_mode Jason A. Donenfeld
2025-11-20  1:10 ` [PATCH libcrypto v2 2/3] compiler: introduce at_least parameter decoration pseudo keyword Jason A. Donenfeld
2025-11-21 11:03   ` Ard Biesheuvel
2025-11-22  2:45   ` Herbert Xu [this message]
2025-11-22  2:46     ` Jason A. Donenfeld
2025-11-22  3:08       ` Herbert Xu
2025-11-22 11:53         ` Ard Biesheuvel
2025-11-22 12:02           ` Jason A. Donenfeld
2025-11-22 19:19   ` Eric Biggers
2025-11-22 19:33     ` Eric Biggers
2025-11-23 13:21     ` Jason A. Donenfeld
2025-11-20  1:10 ` [PATCH libcrypto v2 3/3] crypto: chacha20poly1305: statically check fixed array lengths Jason A. Donenfeld
2025-11-21 11:04   ` Ard Biesheuvel
2025-11-21 11:03 ` [PATCH libcrypto v2 1/3] wifi: iwlwifi: trans: rename at_least variable to min_mode Ard Biesheuvel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aSEj0GvbFjwlDbVM@gondor.apana.org.au \
    --to=herbert@gondor.apana.org.au \
    --cc=Jason@zx2c4.com \
    --cc=ardb@kernel.org \
    --cc=ebiggers@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox