I\'m getting some strange warnings about this code:
typedef double mat4[4][4];
void mprod4(mat4 r, const mat4 a, const mat4 b)
{
/* yes, function is empty *
I think in C99, you can do this, but I'm not sure it will help:
void mprod4(double mr[4][4], double ma[const 4][const 4], double mb[const 4][const 4])
{
}
I haven't got a C99 compiler handy but I remember reading something in the C99 specification regarding qualifiers within the []
for arrays as arguments. You can also put static
in there (e.g. ma[static 4]
) but of course that means something else.
Here it is, section 6.7.3.5 paragraph 7.
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 keywordstatic
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.