c/7272: having problem with pointer to pointer with const in function calling
Thu Jul 11 05:27:00 GMT 2002
>Synopsis: having problem with pointer to pointer with const in function calling
>Arrival-Date: Thu Jul 11 05:06:02 PDT 2002
>Originator: Pradeep S
>Release: gcc 2.95.3 suse linux 7.2 build
suse linux 7.2
i have a function of following kind. Which means to my understanding, ppi is a pointer to pointer to constant integer. ie (**ppi cannot be modified).
void func(const int **ppi)
i tried to call this function like this
//some initialization of ppi stuff
when i compile this, i am getting a warning, which i feel wrong.
it says argument has pointer type mismatch.
i am passing a modifiable data to a function which will not modify the data(hence const, in the hope that in future it may be passed some constant, which does happen in my code).
can u tell a scenario in which this can lead to disaster? so, what does the warning signify?
when formal argument is of type
int *const **pppi;
and actual argument is of type
it says a warning.
but it didnot say anything when formal argument is
int *const *ppi
and actual argument is
what is the diff in above three cases that causes first two to throw a warning while third compiled quitely?
am i bugging u too much?
More information about the Gcc-bugs