Name n3803, alx-0080r2 - [static] without array length expression Principles - Keep the language small and simple Category Language; array parameters. Author Alejandro Colomar Cc: Martin Uecker Acked-by: Doug McIlroy Acked-by: Andrew Clayton Acked-by: onf Acked-by: Alex Celeste History r0 (2026-01-25): - Initial draft. r1 (2026-01-26): - Acked-by. - tfix r2 (2026-02-01; n3803): - Acked-by. Abstract 'static' in [static n] means that the argument shall be non-null. That is entirely independent of the length of the array parameter, so it doesn't make sense requiring the length to be specified. Lift that restriction. Discussion While the standard, for a long time, claimed that 'static' in [static n] was about the length of the array, it is well known that this is only true in paper. In practice, programmers use [n] with that meaning. 'static' in [static n] has a different meaning (see also alx-0079): it says that the argument shall be non-null. See also alx-0079 ("[static n] == non-null [n]") alx-0079 should be applied before alx-0080. Otherwise, the semantics would be undefined. Comments On 2026-01-25T18:19:02-0500, Douglas McIlroy wrote: > All six proposals look eminently reasonable. They simplify > the language and remove surprises. I suspect these proposals > will invalidate very few existing programs. In any event, the > required corrections will improve the legibility and > maintainability of such programs. > > Doug McIlroy --- On 2026-01-26T02:01:16+0000, Alex Celeste wrote: > Like Martin - these all seem eminently reasonable to me. Proposed wording Based on N3685. 6.7.7.1 Declarators :: General @@ Syntax, p1 +array-qualifier-list: + static(opt) type-qualifier-list + type-qualifier-list static + +array-length-declarator: + assignment-expression + * + array-declarator: - direct-declarator [ type-qualifier-list(opt) assignment-expression(opt) ] - direct-declarator [ static type-qualifier-list(opt) assignment-expression ] - direct-declarator [ type-qualifier-list static assignment-expression ] - direct-declarator [ type-qualifier-list(opt) * ] + direct-declarator [ array-qualifier-list(opt) array-length-declarator(opt) ]