|
|
|
|
|
by lenary
2735 days ago
|
|
They are likely to remove this in the next C standard (or may have already), because a declaration with a static size is “compatible” with a declaration with no static size, and thus you can get unsoundness. So your compiler should accept (though the semantics of static suggest this program would be wrong): void foo(int a[static 3]);
void foo(int a[]);
According to the spec, this is fine, but when you come to define the function foo, should it respect the ‘static’ annotation? The spec doesn’t say, and doing static analysis of subsumption for the expressions after ‘static’ is much more complex to keep sound than C prefers in its specification. |
|