[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aXnhf9uAvyJbQfcn@aspen.lan>
Date: Wed, 28 Jan 2026 10:14:23 +0000
From: Daniel Thompson <daniel@...cstar.com>
To: Alejandro Colomar <alx@...nel.org>
Cc: Martin Uecker <uecker@...raz.at>,
Christopher Bazley <chris.bazley.wg14@...il.com>,
Alex Celeste <alexg.nvfp@...il.com>,
Joseph Myers <josmyers@...hat.com>,
Aaron Ballman <aaron@...onballman.com>,
Douglas McIlroy <douglas.mcilroy@...tmouth.edu>,
Bruno Haible <bruno@...sp.org>, Paul Eggert <eggert@...ucla.edu>,
Florian Weimer <fweimer@...hat.com>,
Jonathan Corbet <corbet@....net>, Kees Cook <kees@...nel.org>,
Eric Biggers <ebiggers@...nel.org>,
Ard Biesheuvel <ardb@...nel.org>,
Daniel Thompson <danielt@...nel.org>,
Daniel Lundin <daniel.lundin.mail@...il.com>,
"Valentin V. Bartenev" <vbartenev@...il.com>,
Andrew Clayton <andrew@...ital-domain.net>,
"Brian W. Kernighan" <bwk@...princeton.edu>,
"G. Branden Robinson" <branden@...ian.org>,
"Basil L. Contovounesios" <basil@...tovou.net>,
"Jason A. Donenfeld" <jason@...c4.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
onf <onf@...root.org>, Rich Felker <dalias@...c.org>,
linux-hardening@...r.kernel.org
Subject: Re: [RFC v3 5/6] alx-0081r2 - array parameters of 0 elements
On Mon, Jan 26, 2026 at 01:49:16PM +0100, Alejandro Colomar wrote:
> Proposed wording
> Based on N3685.
>
> 6.7.7.3 Array declarators
> @@ Constraints, p1
> In addition to optional type qualifiers and the keyword static,
> the [ and ] can delimit an expression or *.
> If they delimit an expression,
> called the array length expression,
> the expression shall have an integer type.
> If the expression is a constant expression,
> -it shall have a value greater than zero.
> +it shall have a nonnegative value.
> +An array length expression
> +that is a constant expression with value zero
> +shall appear only in
> +a declaration of a function parameter with an array type,
> +and then only in the outermost array type derivation.
This change did not have any motivating example within the discussion.
Providing a motivational example showing why it is useful to allow array
parameters whose constant length is zero would be good.
Daniel.
Powered by blists - more mailing lists