Regarding the usage of static
in your example, we have this:
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.
Regarding the usage of restrict
in your example, we have this:
In a function declaration, the keyword restrict
may appear inside the square brackets that are used to declare an array type of a function parameter. It qualifies the pointer type to which the array type is transformed:
void f(int m, int n, float a[restrict m][n], float b[restrict m][n]);
void g12(int n, float (*p)[n]) {
f(10, n, p, p+10); // OK
f(20, n, p, p+10); // possibly undefined behavior (depending on what f does)
}
Taking the above together the example:
void funcName(...,
const union some_union_type some_union_arg[restrict static 1]) {
// ...
}
means that whenever funcName
is called, the argument (some_union_arg
) passed will have at least 1 element which the function will be able to access and this access is restrict
ed through some_union_arg
which has been transformed into a pointer.