"static" array type derivation

In the C standard section 6.7.5 point 7, it is stated that I can specify a type qualifier of “static” within the [ and ] of a function argument, the array provided upon every invocation of that function will be at least the size specified. I take this to mean that I can provide a minimum size (implying non-null) for a function argument, but my test code here https://gist.github.com/2417153 seems to indicate that although accepted, there is no enforcement of this in clang. Is my interpretation of the C standard correct? If so, is there plans to add some (limited) compile-time checking of this?

In the C standard section 6.7.5 point 7, it is stated that I can specify a
type qualifier of "static" within the [ and ] of a function argument, the
array provided upon every invocation of that function will be at least the
size specified. I take this to mean that I can provide a minimum size
(implying non-null) for a function argument, but my test code here
a.c · GitHub seems to indicate that although accepted,
there is no enforcement of this in clang. Is my interpretation of the C
standard correct?

I believe so. The code you posted violates a "shall" clause, so it's undefined
behaviour. However it doesn't violate any constraints clauses and it's
syntactically correct so the compiler isn't required by the standard to
produce a diagnostic -- it's just permitted to optimise as if you obeyed the
rules.

It is, of course, a quality of implementation issue and warning about this
would be better.

If so, is there plans to add some (limited) compile-time checking of this?

I'm afraid I don't know of anyone planning to implement that warning, but I
expect the standard comment that a patch would be good applies.

Tim.

Yep. It would need to be implemented in a very performance-neutral way,
because I'm not sure I've ever seen an actual 'static' annotation in real code.

John.