[LCP]Incompatible Types

David Lloyd lloy0076 at rebel.net.au
Wed Mar 27 14:29:04 UTC 2002


Hmmmm...


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);



My program goes:

#include <stdio.h>
#include <stdlib.h>
#include <popt.h>

int main(int argc, char *argv[]) {
         int ret;

         char *name=malloc(sizeof(char)*256);

         struct poptOption opt[] = {
         {"username", 'u', POPT_ARG_STRING, name, 1}
         };

         poptContext context=poptGetContext(NULL, argc, argv, opt, 0);
         poptFreeContext(context);
         return 0;
}



And I get:

[lloy0076 at isengard c]$ make
gcc -o popt `exec gnome-config --cflags gnome` `exec gnome-config --libs 
gnome`
popt.c
popt.c: In function `main':
popt.c:14: warning: passing arg 3 of `poptGetContext' from incompatible 
pointer
type


I think it's complaining about my char *argv[] declaration...

Any thoughts?

DSL

(ps:)
I am using gnome-config because I can't be bothered about working out 
which libraries blah to include to get popt working and I know that 
gnome uses it


-- 
Look down, look down!
   Don't look 'em in the eye,
Look down, look down!
   A slave until you die.     ...Les Miserables (the musical)





More information about the linuxCprogramming mailing list