BIND 10 trac1324, updated. 6c53fd185f27145746e2ffdd596cfbe482919188 [1324] Avoid complaints from clang Corrected declarations
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Nov 21 02:59:29 UTC 2011
The branch, trac1324 has been updated
via 6c53fd185f27145746e2ffdd596cfbe482919188 (commit)
from 631c5c2d24ba8be2b12930cc8267b2298414d563 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6c53fd185f27145746e2ffdd596cfbe482919188
Author: John DuBois <johnd at isc.org>
Date: Sun Nov 20 18:57:24 2011 -0800
[1324]
Avoid complaints from clang
Corrected declarations
-----------------------------------------------------------------------
Summary of changes:
tests/tools/perfdhcp/cloptions.c | 6 +++---
tests/tools/perfdhcp/procconf.c | 9 ++++++---
tests/tools/perfdhcp/procconf.h | 2 +-
3 files changed, 10 insertions(+), 7 deletions(-)
-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/cloptions.c b/tests/tools/perfdhcp/cloptions.c
index cfc9acd..b921dc3 100644
--- a/tests/tools/perfdhcp/cloptions.c
+++ b/tests/tools/perfdhcp/cloptions.c
@@ -119,11 +119,11 @@ perfdhcp [-hv] [-4|-6] [-r<rate>] [-n<num-request>] [-p<test-period>]\n\
} else {
if (v6) {
fprintf(stderr,
- "%s: Use -l to specify an interface name.\n\%s\n",
+ "%s: Use -l to specify an interface name.\n%s\n",
PROGNAME, usage);
}
else {
- fprintf(stderr, "%s: Must specify a DHCP server.\n\%s\n",
+ fprintf(stderr, "%s: Must specify a DHCP server.\n%s\n",
PROGNAME, usage);
}
return(2);
@@ -133,7 +133,7 @@ perfdhcp [-hv] [-4|-6] [-r<rate>] [-n<num-request>] [-p<test-period>]\n\
server = argv[0];
break;
default:
- fprintf(stderr, "%s: Too many arguments.\n\%s\n", PROGNAME, usage);
+ fprintf(stderr, "%s: Too many arguments.\n%s\n", PROGNAME, usage);
return(2);
}
return(1);
diff --git a/tests/tools/perfdhcp/procconf.c b/tests/tools/perfdhcp/procconf.c
index 8fac58a..1d939d8 100644
--- a/tests/tools/perfdhcp/procconf.c
+++ b/tests/tools/perfdhcp/procconf.c
@@ -276,8 +276,9 @@ addOptVal(const char* value, const confvar_t* varDesc,
* On error, a string describing the error is stored in the global errmsg and
* -1 is returned.
*/
+
static int
-procCmdLineArgs(int* argc, const char** argv[], const confvar_t optConf[],
+procCmdLineArgs(int* argc, const char*** argv, const confvar_t optConf[],
confval** perOptRecordsFirst, confval** perOptRecordsLast) {
char* p;
extern char* optarg; /* For getopt */
@@ -308,7 +309,9 @@ procCmdLineArgs(int* argc, const char** argv[], const confvar_t optConf[],
*p = '\0';
optind = 1;
- while ((optchar = getopt(*argc, *argv, optstr)) != -1)
+ // The reality is that getopt does *not* modify the strings,
+ // and GNU getopt *does* modify the pointers!
+ while ((optchar = getopt(*argc, (char* const *)*argv, optstr)) != -1)
{
int ind;
int ret;
@@ -370,7 +373,7 @@ procCmdLineArgs(int* argc, const char** argv[], const confvar_t optConf[],
* On error, a message describing the problem.
*/
const char*
-procOpts(int* argc, const char** argv[], const confvar_t optConf[],
+procOpts(int* argc, char const*** argv, const confvar_t optConf[],
confdata_t* confdata, const char name[],
const char usage[]) {
/*
diff --git a/tests/tools/perfdhcp/procconf.h b/tests/tools/perfdhcp/procconf.h
index 73994a7..b2169d0 100644
--- a/tests/tools/perfdhcp/procconf.h
+++ b/tests/tools/perfdhcp/procconf.h
@@ -120,7 +120,7 @@ typedef struct {
* On error, a message describing the problem.
*/
const char*
-procOpts(int* argc, const char** argv[], const confvar_t optConf[],
+procOpts(int* argc, char const*** argv, const confvar_t optConf[],
confdata_t* confdata, const char name[],
const char usage[]);
More information about the bind10-changes
mailing list