Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What version of C is this in? And do modern implementations (clang, GCC) adhere to it (without extensions)?


It's a feature added in C99. Both clang and GCC do support it, assuming -std=c99 or later


It is C99 so it has been part of the language for a very long time


Just to add, from the N1256 draft of C99, 6.7.5.3:

A declaration of a parameter as ‘‘array of type’’ shall be adjusted to ‘‘qualified pointer to type’’, where the type qualifiers (if any) are those specified within the [ and ] of the array type derivation. If the keyword static also appears within the [ and ] of the array type derivation, then for each call to the function, the value of the corresponding actual argument shall provide access to the first element of an array with at least as many elements as specified by the size expression.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: