hi,
i'm using "gcc version 3.3.3 (Debian)" to compile the program pasted below.
I get the two warnings you can see in the remarks. The second warning is
perfectly OK for me, but the first one I don't understand.
Isn't the "const int *" construct in the signature of func1 a hint for the
user, that func1 doesn't modify **arg? Why then is it dangerous to
pass an alterable argmument?
thanks for your help!
----------------------------------------------------
void func1(const int *arg[]) { }
void func2(int *arg[]) { }
int main(argc)
{
const int *ary1[10];
int *ary2[10];
func1(ary1);
func1(ary2); // warning: passing arg 1 of `func1' from incompatible pointer type
func2(ary1); // warning: passing arg 1 of `func2' from incompatible pointer type
func2(ary2);
}
----------------------------------------------------