Bug 2086 - rpcclient: const char ** is incompatible with char *const *
Summary: rpcclient: const char ** is incompatible with char *const *
Status: RESOLVED DUPLICATE of bug 2504
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: Client Tools (show other bugs)
Version: 3.0.9
Hardware: SGI IRIX
: P3 normal
Target Milestone: none
Assignee: Tim Potter
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-11-24 10:25 UTC by Jason Mader (mail bounces back)
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 (mail bounces back)
no flags Details
rpcclient patch (32.72 KB, patch)
2004-11-24 13:24 UTC, Jason Mader (mail bounces back)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Mader (mail bounces back) 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 (mail bounces back) 2004-11-24 11:50:20 UTC
Created attachment 807 [details]
rpcclient patch
Comment 2 Jason Mader (mail bounces back) 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 (mail bounces back) 2004-11-24 13:24:03 UTC
Created attachment 808 [details]
rpcclient patch
Comment 4 Jason Mader (mail bounces back) 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 (mail bounces back) 2005-03-21 12:37:59 UTC

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