Bug 2086 - rpcclient: const char ** is incompatible with char *const *
rpcclient: const char ** is incompatible with char *const *
Status: RESOLVED DUPLICATE of bug 2504
Product: Samba 3.0
Classification: Unclassified
Component: Client Tools
3.0.9
SGI IRIX
: P3 normal
: none
Assigned To: Tim Potter
Samba QA Contact
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-24 10:25 UTC by Jason Mader
Modified: 2005-03-21 12:37 UTC (History)
0 users

See Also:


Attachments
rpcclient patch (22.67 KB, patch)
2004-11-24 11:50 UTC, Jason Mader
no flags Details
rpcclient patch (32.72 KB, patch)
2004-11-24 13:24 UTC, Jason Mader
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader 2004-11-24 10:25:16 UTC
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)

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

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


getopt expects argv to be 'char *const *'
    int getopt (int argc, char * const argv[], const char *optstring);

An explicit type conversion in the two getop() calls will quiet the warning.  A change in arguments to 
the functions cmd_shutdown_init() and cmd_reg_shutdown() means changes to arguments in 
lots of functions in rpcclient/, rpc_parse/ and rpc_client/ because (*ntfn) would have to change too.
Comment 1 Jason Mader 2004-11-24 11:50:20 UTC
Created attachment 807 [details]
rpcclient patch
Comment 2 Jason Mader 2004-11-24 11:55:14 UTC
patch file (id=807) are all the changes to the rpcclient/ files necessary if the argument to 
cmd_shutdown_init() and cmd_reg_shutdown() is changed to be consistent with getopt().

This changed (*ntfn) in rpcclient/rpcclient.h, but not (*wfn).  If the patch is a good idea, then (*wfn) and 
everything it affects should probably be changed also.
Comment 3 Jason Mader 2004-11-24 13:24:03 UTC
Created attachment 808 [details]
rpcclient patch
Comment 4 Jason Mader 2004-11-24 13:26:42 UTC
It turned out that changing both functions in rpcclient/rpcclient.h only affected files in rpcclient/.  
Version 2 of this patch (id=808) only affects files in rpcclient/ after all files have been changed so that 
argv is of the same type is in getopt().
Comment 5 Jason Mader 2005-03-21 12:37:59 UTC

*** This bug has been marked as a duplicate of 2504 ***