On 2025-12-15 14:17, Alejandro Colomar wrote:
As a side note, the attribute should go before the type:
Which is yet another reason to dislike the attribute syntax. That's one
more rule to remember, and I often forget it. Among other things I don't
know exactly why the C23 attribute must precede the return type (and I
suspect hardly any other C programmers do either).
ATTRIBUTE_NONNULL ((2))
int
main (int argc, char *argv[VLA_ELEMS (argc)])
Yeah, but no. Info specific to a parameter belongs with the parameter
declaration, not in a disconnected region that could be many lines away.
which compilers don't support [n] in function
parameters?
Every C89-or-later compiler supports the syntax if n is an integer
constant expression. If not, things get trickier; I don't offhand know
which current compilers support it, but I vaguely recall that Microsoft
compilers do not.