Why does the following program give a warning?
Note: Its obvious that sending a normal pointer to a function requiring const pointer does not give any warning.
#include <stdio.h>
void sam(const char **p) { }
int main(int argc, char **argv)
{
sam(argv);
return 0;
}
I get the following error,
In function `int main(int, char **)':
passing `char **' as argument 1 of `sam(const char **)'
adds cv-quals without intervening `const'