[LCP]Incompatible Types 
    Greg Black 
    gjb at gbch.net
       
    Wed Mar 27 14:54:04 UTC 2002
    
    
  
David Lloyd wrote:
| The definition is as follows:
| 
| /*@only@*/ poptContext poptGetContext(/*@keep@*/ const char * name,
|        int argc, /*@keep@*/ const char ** argv,
|        /*@keep@*/ const struct poptOption * options, int flags);
This declaration is wrong -- argv is not `const'.  The Standard
says:
    The parameters argc and argv and the strings pointed to by
    the argv array shall be modifiable by the program [...]
| int main(int argc, char *argv[]) {
This is a correct declaration.
| popt.c:14: warning: passing arg 3 of `poptGetContext' from
| incompatible pointer type
The diagnostic is correct, given the (incorrect) declaration in
popt.h -- but it's the header that is wrong.
Greg
    
    
More information about the linuxCprogramming
mailing list