From: Harlan Stenn Date: Sat, 21 Feb 2015 10:35:38 +0000 (+0000) Subject: [Bug 2757] Quiet compiler warnings X-Git-Tag: NTP_4_3_1~3^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3b546227cdf7ee2cab6474a4de7872175cf1c790;p=thirdparty%2Fntp.git [Bug 2757] Quiet compiler warnings bk: 54e85f7afd-U0LXK_qKlY0qAKYcGwQ --- diff --git a/ChangeLog b/ChangeLog index 99784228b..9e517dcc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * [Bug 2728] See if C99-style structure initialization works. * [Bug 2747] Upgrade libevent to 2.1.5-beta. * [Bug 2749] ntp/lib/NTP/Util.pm needs update for ntpq -w, IPv6, .POOL. . +* [Bug 2757] Quiet compiler warnings. --- (4.2.8p1) 2015/02/04 Released by Harlan Stenn diff --git a/lib/isc/result.c b/lib/isc/result.c index 520f1613a..da57272df 100644 --- a/lib/isc/result.c +++ b/lib/isc/result.c @@ -172,7 +172,7 @@ const char * isc_result_totext(isc_result_t result) { resulttable *table; const char *txt, *default_text; - int index; + int idx; initialize(); @@ -183,15 +183,15 @@ isc_result_totext(isc_result_t result) { table != NULL; table = ISC_LIST_NEXT(table, link)) { if (result >= table->base && result <= table->last) { - index = (int)(result - table->base); - default_text = table->text[index]; + idx = (int)(result - table->base); + default_text = table->text[idx]; /* - * Note: we use 'index + 1' as the message number - * instead of index because isc_msgcat_get() requires + * Note: we use 'idx + 1' as the message number + * instead of idx because isc_msgcat_get() requires * the message number to be > 0. */ txt = isc_msgcat_get(table->msgcat, table->set, - index + 1, default_text); + idx + 1, default_text); break; } } diff --git a/lib/isc/unix/file.c b/lib/isc/unix/file.c index 3b59e86b0..9eda4a33b 100644 --- a/lib/isc/unix/file.c +++ b/lib/isc/unix/file.c @@ -508,7 +508,7 @@ isc_file_safecreate(const char *filename, FILE **fp) { } isc_result_t -isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename) +isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirnam, char **basenam) { char *dir, *file, *slash; @@ -537,8 +537,8 @@ isc_file_splitpath(isc_mem_t *mctx, char *path, char **dirname, char **basename) return (ISC_R_INVALIDFILE); } - *dirname = dir; - *basename = file; + *dirnam = dir; + *basenam = file; return (ISC_R_SUCCESS); } diff --git a/lib/isc/unix/ifiter_ioctl.c b/lib/isc/unix/ifiter_ioctl.c index a684867ce..f9a3affe6 100644 --- a/lib/isc/unix/ifiter_ioctl.c +++ b/lib/isc/unix/ifiter_ioctl.c @@ -109,6 +109,10 @@ struct isc_interfaceiter { #endif #endif +/* Silence a warning when this file is #included */ +int +isc_ioctl(int fildes, int req, char *arg); + int isc_ioctl(int fildes, int req, char *arg) { int trys; diff --git a/lib/isc/unix/net.c b/lib/isc/unix/net.c index 2ba17d165..7056668ca 100644 --- a/lib/isc/unix/net.c +++ b/lib/isc/unix/net.c @@ -106,7 +106,8 @@ const struct in6_addr isc_net_in6addrloop = IN6ADDR_LOOPBACK_INIT; static isc_once_t once_ipv6only = ISC_ONCE_INIT; # endif -# if defined(ISC_PLATFORM_HAVEIN6PKTINFO) +# if defined(ISC_PLATFORM_HAVEIPV6) && \ + defined(WANT_IPV6) && defined(ISC_PLATFORM_HAVEIN6PKTINFO) static isc_once_t once_ipv6pktinfo = ISC_ONCE_INIT; # endif #endif /* ISC_PLATFORM_HAVEIPV6 */ diff --git a/libntp/work_fork.c b/libntp/work_fork.c index 10329e70b..dab02bc6a 100644 --- a/libntp/work_fork.c +++ b/libntp/work_fork.c @@ -382,7 +382,7 @@ fork_blocking_child( int rc; int was_pipe; int is_pipe; - int saved_errno; + int saved_errno = 0; int childpid; int keep_fd; int fd; diff --git a/ntpd/ntp_crypto.c b/ntpd/ntp_crypto.c index 089dc6f28..5795ae8df 100644 --- a/ntpd/ntp_crypto.c +++ b/ntpd/ntp_crypto.c @@ -1731,7 +1731,7 @@ crypto_args( tstamp_t tstamp; /* NTP timestamp */ struct exten *ep; /* extension field pointer */ u_int len; /* extension field length */ - size_t slen; + size_t slen = 0; tstamp = crypto_time(); len = sizeof(struct exten);