c - passing arg 1 of `foo' from incompatible pointer type -
why shows warning:
#include<stdio.h> foo (const char **p) { } int main(int argc , char **argv) { foo(argv); }
but following not show warning
char * cp; const char *ccp; ccp = cp;
the first code snippet shows warning passing arg 1 of foo
incompatible pointer type. second snippet not show warning. both const
pointers
see c faq list
you can cast in order remove warnings:
foo((const char **)argv);
but faq says: need such cast may indicate deeper problem cast doesn't fix.
Comments
Post a Comment