From: Wouter Wijngaards Date: Thu, 24 Jan 2019 16:05:00 +0000 (+0000) Subject: - Patch from Florian Obser fixes some compiler warnings: X-Git-Tag: release-1.9.0rc1~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3028fa50a8fefc48f79cab00ce522b13ad6d2b4d;p=thirdparty%2Funbound.git - Patch from Florian Obser fixes some compiler warnings: include mini_event.h to have a prototype for mini_ev_cmp include edns.h to have a prototype for apply_edns_options sldns_wire2str_edns_keepalive_print is only called in the wire2str, module declare it static to get rid of compiler warning: no previous prototype for function infra_find_ip_ratedata() is only called in the infra module, declare it static to get rid of compiler warning: no previous prototype for function do not shadow local variable buf in authzone auth_chunks_delete and az_nsec3_findnode are only called in the authzone module, declare them static to get rid of compiler warning: no previous prototype for function... copy_rrset() is only called in the respip module, declare it static to get rid of compiler warning: no previous prototype for function 'copy_rrset' no need for another variable "r"; gets rid of compiler warning: declaration shadows a local variable in libunbound.c no need for another variable "ns"; gets rid of compiler warning: declaration shadows a local variable in iterator.c git-svn-id: file:///svn/unbound/trunk@5072 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/doc/Changelog b/doc/Changelog index 3bd7d86c4..b9bbd8720 100644 --- a/doc/Changelog +++ b/doc/Changelog @@ -10,6 +10,26 @@ testcode for unknown macro operand give zero result. Initialise the passed argv array in test code. In test code add EDNS data segment copy only when nonempty. + - Patch from Florian Obser fixes some compiler warnings: + include mini_event.h to have a prototype for mini_ev_cmp + include edns.h to have a prototype for apply_edns_options + sldns_wire2str_edns_keepalive_print is only called in the wire2str, + module declare it static to get rid of compiler warning: + no previous prototype for function + infra_find_ip_ratedata() is only called in the infra module, + declare it static to get rid of compiler warning: + no previous prototype for function + do not shadow local variable buf in authzone + auth_chunks_delete and az_nsec3_findnode are only called in the + authzone module, declare them static to get rid of compiler warning: + no previous prototype for function... + copy_rrset() is only called in the respip module, declare it + static to get rid of compiler warning: + no previous prototype for function 'copy_rrset' + no need for another variable "r"; gets rid of compiler warning: + declaration shadows a local variable in libunbound.c + no need for another variable "ns"; gets rid of compiler warning: + declaration shadows a local variable in iterator.c 23 January 2018: Wouter - Patch from Manabu Sonoda with tls-ciphers and tls-ciphersuites diff --git a/iterator/iterator.c b/iterator/iterator.c index a3b52806a..8312dfd53 100644 --- a/iterator/iterator.c +++ b/iterator/iterator.c @@ -1882,7 +1882,6 @@ processLastResort(struct module_qstate* qstate, struct iter_qstate* iq, struct delegpt* p = hints_lookup_root(qstate->env->hints, iq->qchase.qclass); if(p) { - struct delegpt_ns* ns; struct delegpt_addr* a; iq->chase_flags &= ~BIT_RD; /* go to authorities */ for(ns = p->nslist; ns; ns=ns->next) { diff --git a/libunbound/libunbound.c b/libunbound/libunbound.c index 31adbd54d..0e59364d5 100644 --- a/libunbound/libunbound.c +++ b/libunbound/libunbound.c @@ -724,7 +724,7 @@ ub_resolve_event(struct ub_ctx* ctx, const char* name, int rrtype, *async_id = 0; lock_basic_lock(&ctx->cfglock); if(!ctx->finalized) { - int r = context_finalize(ctx); + r = context_finalize(ctx); if(r) { lock_basic_unlock(&ctx->cfglock); return r; diff --git a/respip/respip.c b/respip/respip.c index aea528f15..bcb31f892 100644 --- a/respip/respip.c +++ b/respip/respip.c @@ -451,7 +451,7 @@ respip_views_apply_cfg(struct views* vs, struct config_file* cfg, * This function returns the copied rrset key on success, and NULL on memory * allocation failure. */ -struct ub_packed_rrset_key* +static struct ub_packed_rrset_key* copy_rrset(const struct ub_packed_rrset_key* key, struct regional* region) { struct ub_packed_rrset_key* ck = regional_alloc(region, diff --git a/services/authzone.c b/services/authzone.c index 03991d9b8..a87c2274f 100644 --- a/services/authzone.c +++ b/services/authzone.c @@ -1982,7 +1982,7 @@ int auth_zones_apply_cfg(struct auth_zones* az, struct config_file* cfg, * @param at: transfer structure with chunks list. The chunks and their * data are freed. */ -void +static void auth_chunks_delete(struct auth_transfer* at) { if(at->chunks_first) { @@ -2621,7 +2621,7 @@ az_nsec3_hashname(struct auth_zone* z, uint8_t* hashname, size_t* hashnmlen, } /** Find the datanode that covers the nsec3hash-name */ -struct auth_data* +static struct auth_data* az_nsec3_findnode(struct auth_zone* z, uint8_t* hashnm, size_t hashnmlen) { struct query_info qinfo; @@ -4997,12 +4997,12 @@ xfr_transfer_lookup_host(struct auth_xfer* xfr, struct module_env* env) qinfo.qtype = LDNS_RR_TYPE_AAAA; qinfo.local_alias = NULL; if(verbosity >= VERB_ALGO) { - char buf[512]; + char buf1[512]; char buf2[LDNS_MAX_DOMAINLEN+1]; dname_str(xfr->name, buf2); - snprintf(buf, sizeof(buf), "auth zone %s: master lookup" + snprintf(buf1, sizeof(buf1), "auth zone %s: master lookup" " for task_transfer", buf2); - log_query_info(VERB_ALGO, buf, &qinfo); + log_query_info(VERB_ALGO, buf1, &qinfo); } edns.edns_present = 1; edns.ext_rcode = 0; @@ -6037,12 +6037,12 @@ xfr_probe_lookup_host(struct auth_xfer* xfr, struct module_env* env) qinfo.qtype = LDNS_RR_TYPE_AAAA; qinfo.local_alias = NULL; if(verbosity >= VERB_ALGO) { - char buf[512]; + char buf1[512]; char buf2[LDNS_MAX_DOMAINLEN+1]; dname_str(xfr->name, buf2); - snprintf(buf, sizeof(buf), "auth zone %s: master lookup" + snprintf(buf1, sizeof(buf1), "auth zone %s: master lookup" " for task_probe", buf2); - log_query_info(VERB_ALGO, buf, &qinfo); + log_query_info(VERB_ALGO, buf1, &qinfo); } edns.edns_present = 1; edns.ext_rcode = 0; diff --git a/services/cache/infra.c b/services/cache/infra.c index 489f93949..07c41928d 100644 --- a/services/cache/infra.c +++ b/services/cache/infra.c @@ -808,7 +808,7 @@ static struct lruhash_entry* infra_find_ratedata(struct infra_cache* infra, } /** find data item in array for ip addresses */ -struct lruhash_entry* infra_find_ip_ratedata(struct infra_cache* infra, +static struct lruhash_entry* infra_find_ip_ratedata(struct infra_cache* infra, struct comm_reply* repinfo, int wr) { struct ip_rate_key key; diff --git a/sldns/wire2str.c b/sldns/wire2str.c index 832239f9b..01ec84b3c 100644 --- a/sldns/wire2str.c +++ b/sldns/wire2str.c @@ -1908,8 +1908,8 @@ int sldns_wire2str_edns_subnet_print(char** s, size_t* sl, uint8_t* data, return w; } -int sldns_wire2str_edns_keepalive_print(char** s, size_t* sl, uint8_t* data, - size_t len) +static int sldns_wire2str_edns_keepalive_print(char** s, size_t* sl, + uint8_t* data, size_t len) { int w = 0; uint16_t timeout; diff --git a/util/edns.c b/util/edns.c index 2c4e4a1fd..1fa6b2921 100644 --- a/util/edns.c +++ b/util/edns.c @@ -42,6 +42,7 @@ #include "config.h" #include "util/config_file.h" +#include "util/edns.h" #include "util/netevent.h" #include "util/regional.h" #include "util/data/msgparse.h" diff --git a/util/mini_event.c b/util/mini_event.c index 14e9efe47..ee517b263 100644 --- a/util/mini_event.c +++ b/util/mini_event.c @@ -41,6 +41,7 @@ */ #include "config.h" +#include "util/mini_event.h" #ifdef HAVE_TIME_H #include #endif