[Bug 2054] change argv type in rpcclient cmd_ functions

Jason Mader jason at ncac.gwu.edu
Mon Mar 21 20:08:58 GMT 2005


While compiling Samba 3.0.12 bin/rpcclient, I had this warning:

Compiling rpcclient/cmd_shutdown.c
cc-1164 cc: WARNING File = rpcclient/cmd_shutdown.c, Line = 43
   Argument of type "const char **" is incompatible with parameter of 
type
           "char *const *".

         while ((opt = getopt(argc, argv, "m:t:rf")) != EOF)
                                    ^

All the argv parameters of the cmd_ functions in rpcclient are "const 
char **" while getopt() expects "char *const *".  Although getopt() is 
only used in two of the cmd_ functions, it seemed apropos to change it 
be consistent with getopt().  I've attached a patch to Bug 2054 that 
changes the type on argv and adds needed casts on calls that pass argv 
to a "const char **".  Though this is a simple but tedious change, it 
seemed like the right thing.

---Jason Mader, FHWA/NHTSA National Crash Analysis Center,
The George Washington University, VA Campus



More information about the samba-technical mailing list