GCC gives a warning when you pass a pointer to an array type to a function which takes a pointer to const array type.
The following code:
void foo (const float (*x) [2])
{
/* do things */
}
int main()
{
float a [2];
foo (&a); /* produces compiler warning with gcc */
return 0;
}
Produces the warning: "expected 'const float (*)[2]' but argument is of type 'float (*)[2]'"
As far as I am aware, array types are their own separate types and as such you should be able to pass pointers to them in this way. It is not the same problem as passing a "float**" to an function which takes a "const float **". Or is it?
Only gcc seems to give warnings about this, clang is perfectly happy with it.