You cannot have the passed array size to depend on a variable (moreover, passed in the same signature). It compiles in Clang, but it's not legal C89, it is C99 and AFAIK Microsoft VC does not fully support that.
Be careful: you are calling the function and its parameter by the same name and this might lead to funny, obscure errors. Either rename the function or the last parameter.
EDIT: try compiling this:
void ar(int n,int m, short ars[n][m])
{
}
int main()
{
short a[1][2] = {{22,22}};
ar(1,2,a);
}
it goes fine across all compilers installed on my system, so if it doesn't compile, either you have non-standard, exoteric settings enabled in your IDE or you are in strong need of a decent compiler.