Bug 2504 - rpcclient/cmd_shutdown.c line 43: argument type wrong
Summary: rpcclient/cmd_shutdown.c line 43: argument type wrong
Status: CLOSED FIXED
Alias: None
Product: Samba 3.0
Classification: Unclassified
Component: smbclient (show other bugs)
Version: 3.0.12
Hardware: SGI IRIX
: P3 normal
Target Milestone: none
Assignee: Samba Bugzilla Account
QA Contact: Samba QA Contact
URL:
Keywords:
: 2086 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-03-21 09:19 UTC by Jason Mader (mail bounces back)
Modified: 2005-08-24 10:21 UTC (History)
0 users

See Also:


Attachments
changes type on argv to "char *const *" (33.16 KB, patch)
2005-03-21 12:36 UTC, Jason Mader (mail bounces back)
no flags Details
changes type on argv to "char *const *" (33.45 KB, patch)
2005-03-21 13:09 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) 2005-03-21 09:19:40 UTC
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)
                                   ^
Comment 1 Jason Mader (mail bounces back) 2005-03-21 09:25:24 UTC
In cmd_shutdown_init() argv should be "const *char *".

Also, I noticed the getopt() loop in this function checks the return value
against EOF.  That seems unusual, when the usual is to compare it to -1, which
the getopt() man page says is the return value when there are no more options. 
I don't believe EOF is required to be defined as -1 in the C standard.
Comment 2 Jason Mader (mail bounces back) 2005-03-21 12:36:57 UTC
Created attachment 1057 [details]
changes type on argv to "char *const *"
Comment 3 Jason Mader (mail bounces back) 2005-03-21 12:38:00 UTC
*** Bug 2086 has been marked as a duplicate of this bug. ***
Comment 4 Jason Mader (mail bounces back) 2005-03-21 13:09:30 UTC
Created attachment 1058 [details]
changes type on argv to "char *const *"

Makes one change over the previous patch to make an existing typecast
syntactically consistent with the others.
Comment 5 Gerald (Jerry) Carter (dead mail address) 2005-03-22 10:26:50 UTC
removed offending code.  Should be using 'net rpc shutdown' instead.
Same reason why I removed the code from cmd_reg.c
Comment 6 Gerald (Jerry) Carter (dead mail address) 2005-08-24 10:21:47 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.