summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Toorop <willem@nlnetlabs.nl>2016-10-17 21:46:47 +0200
committerWillem Toorop <willem@nlnetlabs.nl>2016-10-17 21:46:47 +0200
commitc4be9992a306af40b16bcc72c853ae1223bcd148 (patch)
treea1d9d52955ff6ae432176e7aaf39ace9b840443f
parent45cb42fe4dbb768d4f1d64f671c866b68119e114 (diff)
downloadldns-c4be9992a306af40b16bcc72c853ae1223bcd148.tar.gz
bugfix #796-792: Fix compiler warning issues.
-rw-r--r--Changelog3
-rw-r--r--configure.ac4
-rw-r--r--drill/work.c4
-rw-r--r--examples/ldns-dane.c48
-rw-r--r--examples/ldns-keyfetcher.c2
-rw-r--r--examples/ldns-read-zone.c6
-rw-r--r--examples/ldns-signzone.c2
-rw-r--r--examples/ldns-test-edns.c4
-rw-r--r--examples/ldns-testns.c1
-rw-r--r--examples/ldns-testpkts.c2
-rw-r--r--examples/ldns-verify-zone.c2
-rw-r--r--examples/ldns-walk.c6
-rw-r--r--examples/ldnsd.c4
-rw-r--r--host2wire.c2
14 files changed, 47 insertions, 43 deletions
diff --git a/Changelog b/Changelog
index 3e13dead..a39aef93 100644
--- a/Changelog
+++ b/Changelog
@@ -77,7 +77,8 @@ TBD
* bugfix #641: Include install-sh in .gitignore
* bugfix #825: Module import breaks with newer SWIG versions.
Thanks Christoph Egger
- * bugfix #796: Fix -Wshadow issues. Thanks Ngie Cooper
+ * bugfix #796 - #792: Fix miscellaneous compiler warning issues.
+ Thanks Ngie Cooper
1.6.17 2014-01-10
* Fix ldns_dnssec_zone_new_frm_fp_l to allow the last parsed line of a
diff --git a/configure.ac b/configure.ac
index 7bc7b765..0d2607f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,7 +77,9 @@ ACX_CHECK_COMPILER_FLAG(Wall, [CFLAGS="-Wall $CFLAGS"])
ACX_CHECK_COMPILER_FLAG(W, [CFLAGS="-W $CFLAGS"])
ACX_CHECK_COMPILER_FLAG(Wwrite-strings, [CFLAGS="-Wwrite-strings $CFLAGS"])
ACX_CHECK_COMPILER_FLAG(Wstrict-prototypes, [CFLAGS="-Wstrict-prototypes $CFLAGS"])
-
+ACX_CHECK_COMPILER_FLAG(Wshadow, [CFLAGS="-Wshadow $CFLAGS"])
+ACX_CHECK_COMPILER_FLAG(Wunused-function, [CFLAGS="-Wunused-function $CFLAGS"])
+ACX_CHECK_COMPILER_FLAG(Wmissing-prototypes, [CFLAGS="-Wmissing-prototypes $CFLAGS"])
AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT])
diff --git a/drill/work.c b/drill/work.c
index 370d48b0..ce61c235 100644
--- a/drill/work.c
+++ b/drill/work.c
@@ -18,7 +18,7 @@
*
* This function returns the length of the result
*/
-size_t
+static size_t
hexstr2bin(char *hexstr, int len, uint8_t *buf, size_t offset, size_t buf_len)
{
char c;
@@ -64,7 +64,7 @@ hexstr2bin(char *hexstr, int len, uint8_t *buf, size_t offset, size_t buf_len)
return bufpos;
}
-size_t
+static size_t
packetbuffromfile(char *filename, uint8_t *wire)
{
FILE *fp = NULL;
diff --git a/examples/ldns-dane.c b/examples/ldns-dane.c
index 20a89ee6..7997e15f 100644
--- a/examples/ldns-dane.c
+++ b/examples/ldns-dane.c
@@ -58,7 +58,7 @@
/* int verbosity = 3; */
-void
+static void
print_usage(const char* progname)
{
printf("Usage: %s [OPTIONS] verify <name> <port>\n", progname);
@@ -137,7 +137,7 @@ print_usage(const char* progname)
exit(EXIT_SUCCESS);
}
-int
+static int
dane_int_within_range(const char* arg, int max, const char* name)
{
char* endptr; /* utility var for strtol usage */
@@ -206,7 +206,7 @@ dane_param_choice dane_matching_type_table[] = {
{ NULL, -1 }
};
-int
+static int
dane_int_within_range_table(const char* arg, int max, const char* name,
dane_param_choice table[])
{
@@ -222,7 +222,7 @@ dane_int_within_range_table(const char* arg, int max, const char* name,
return dane_int_within_range(arg, max, name);
}
-void
+static void
ssl_err(const char* s)
{
fprintf(stderr, "error: %s\n", s);
@@ -230,7 +230,7 @@ ssl_err(const char* s)
exit(EXIT_FAILURE);
}
-void
+static void
ldns_err(const char* s, ldns_status err)
{
if (err == LDNS_STATUS_SSL_ERR) {
@@ -241,7 +241,7 @@ ldns_err(const char* s, ldns_status err)
}
}
-ldns_status
+static ldns_status
ssl_connect_and_get_cert_chain(
X509** cert, STACK_OF(X509)** extra_certs,
SSL* ssl, const char* name_str,
@@ -322,7 +322,7 @@ ssl_connect_and_get_cert_chain(
}
-void
+static void
ssl_interact(SSL* ssl)
{
fd_set rfds;
@@ -410,7 +410,7 @@ ssl_interact(SSL* ssl)
}
-ldns_rr_list*
+static ldns_rr_list*
rr_list_filter_rr_type(ldns_rr_list* l, ldns_rr_type t)
{
size_t i;
@@ -440,7 +440,7 @@ rr_list_filter_rr_type(ldns_rr_list* l, ldns_rr_type t)
*
* This to check what would happen if PKIX validation was successfull always.
*/
-ldns_rr_list*
+static ldns_rr_list*
dane_no_pkix_transform(const ldns_rr_list* tlas)
{
size_t i;
@@ -502,7 +502,7 @@ dane_no_pkix_transform(const ldns_rr_list* tlas)
return r;
}
-void
+static void
print_rr_as_TYPEXXX(FILE* out, ldns_rr* rr)
{
size_t i, sz;
@@ -533,7 +533,7 @@ print_rr_as_TYPEXXX(FILE* out, ldns_rr* rr)
LDNS_FREE(str);
}
-void
+static void
print_rr_list_as_TYPEXXX(FILE* out, ldns_rr_list* l)
{
size_t i;
@@ -543,7 +543,7 @@ print_rr_list_as_TYPEXXX(FILE* out, ldns_rr_list* l)
}
}
-ldns_status
+static ldns_status
read_key_file(const char *filename, ldns_rr_list *keys)
{
ldns_status status = LDNS_STATUS_ERR;
@@ -582,7 +582,7 @@ read_key_file(const char *filename, ldns_rr_list *keys)
}
-ldns_status
+static ldns_status
dane_setup_resolver(ldns_resolver** res, ldns_rdf* nameserver_addr,
ldns_rr_list* keys, bool dnssec_off)
{
@@ -611,7 +611,7 @@ dane_setup_resolver(ldns_resolver** res, ldns_rdf* nameserver_addr,
}
-ldns_status
+static ldns_status
dane_query(ldns_rr_list** rrs, ldns_resolver* r,
ldns_rdf *name, ldns_rr_type t, ldns_rr_class c,
bool insecure_is_ok)
@@ -716,7 +716,7 @@ cleanup:
}
-ldns_rr_list*
+static ldns_rr_list*
dane_lookup_addresses(ldns_resolver* res, ldns_rdf* dname,
int ai_family)
{
@@ -783,7 +783,7 @@ dane_lookup_addresses(ldns_resolver* res, ldns_rdf* dname,
return r;
}
-ldns_status
+static ldns_status
dane_read_tlsas_from_file(ldns_rr_list** tlsas,
char* filename, ldns_rdf* origin)
{
@@ -875,7 +875,7 @@ error:
return s;
}
-bool
+static bool
dane_wildcard_label_cmp(uint8_t iw, const char* w, uint8_t il, const char* l)
{
if (iw == 0) { /* End of match label */
@@ -918,7 +918,7 @@ dane_wildcard_label_cmp(uint8_t iw, const char* w, uint8_t il, const char* l)
return iw == 0 && il == 0;
}
-bool
+static bool
dane_label_matches_label(ldns_rdf* w, ldns_rdf* l)
{
uint8_t iw;
@@ -931,7 +931,7 @@ dane_label_matches_label(ldns_rdf* w, ldns_rdf* l)
il, (const char*)ldns_rdf_data(l) + 1);
}
-bool
+static bool
dane_name_matches_server_name(const char* name_str, ldns_rdf* server_name)
{
ldns_rdf* name;
@@ -971,7 +971,7 @@ dane_name_matches_server_name(const char* name_str, ldns_rdf* server_name)
return true;
}
-bool
+static bool
dane_X509_any_subject_alt_name_matches_server_name(
X509 *cert, ldns_rdf* server_name)
{
@@ -1005,7 +1005,7 @@ dane_X509_any_subject_alt_name_matches_server_name(
return false;
}
-bool
+static bool
dane_X509_subject_name_matches_server_name(X509 *cert, ldns_rdf* server_name)
{
X509_NAME* subject_name;
@@ -1033,7 +1033,7 @@ dane_X509_subject_name_matches_server_name(X509 *cert, ldns_rdf* server_name)
}
}
-bool
+static bool
dane_verify_server_name(X509* cert, ldns_rdf* server_name)
{
ldns_rdf* server_name_lc;
@@ -1051,7 +1051,7 @@ dane_verify_server_name(X509* cert, ldns_rdf* server_name)
return r;
}
-void
+static void
dane_create(ldns_rr_list* tlsas, ldns_rdf* tlsa_owner,
ldns_tlsa_certificate_usage certificate_usage, int offset,
ldns_tlsa_selector selector,
@@ -1089,7 +1089,7 @@ dane_create(ldns_rr_list* tlsas, ldns_rdf* tlsa_owner,
}
}
-bool
+static bool
dane_verify(ldns_rr_list* tlsas, ldns_rdf* address,
X509* cert, STACK_OF(X509)* extra_certs,
X509_STORE* validate_store,
diff --git a/examples/ldns-keyfetcher.c b/examples/ldns-keyfetcher.c
index 17e195b2..10a47ddc 100644
--- a/examples/ldns-keyfetcher.c
+++ b/examples/ldns-keyfetcher.c
@@ -507,7 +507,7 @@ retrieve_dnskeys(ldns_resolver *local_res, ldns_rdf *name, ldns_rr_type t,
* for the root zone and A records for those NS RRs.
* Read them, check them, and append the a records to the rr list given.
*/
-ldns_rr_list *
+static ldns_rr_list *
read_root_hints(const char *filename)
{
FILE *fp = NULL;
diff --git a/examples/ldns-read-zone.c b/examples/ldns-read-zone.c
index bded7929..c61f80ad 100644
--- a/examples/ldns-read-zone.c
+++ b/examples/ldns-read-zone.c
@@ -15,7 +15,7 @@
#include <errno.h>
-void print_usage(const char* progname)
+static void print_usage(const char* progname)
{
printf("Usage: %s [OPTIONS] <zonefile>\n", progname);
printf("\tReads the zonefile and prints it.\n");
@@ -69,7 +69,7 @@ void print_usage(const char* progname)
exit(EXIT_SUCCESS);
}
-void exclude_type(ldns_rdf **show_types, ldns_rr_type t)
+static void exclude_type(ldns_rdf **show_types, ldns_rr_type t)
{
ldns_status s;
@@ -89,7 +89,7 @@ fail:
exit(EXIT_FAILURE);
}
-void include_type(ldns_rdf **show_types, ldns_rr_type t)
+static void include_type(ldns_rdf **show_types, ldns_rr_type t)
{
ldns_status s;
diff --git a/examples/ldns-signzone.c b/examples/ldns-signzone.c
index c77f2e76..975c534c 100644
--- a/examples/ldns-signzone.c
+++ b/examples/ldns-signzone.c
@@ -288,7 +288,7 @@ find_or_create_pubkey(const char *keyfile_name_base, ldns_key *key, ldns_zone *o
}
}
-void
+static void
strip_dnssec_records(ldns_zone *zone)
{
ldns_rr_list *new_list;
diff --git a/examples/ldns-test-edns.c b/examples/ldns-test-edns.c
index b4292a0f..75a0f176 100644
--- a/examples/ldns-test-edns.c
+++ b/examples/ldns-test-edns.c
@@ -15,13 +15,13 @@
/** print error details */
static int verb = 1;
-struct sockaddr_in6* cast_sockaddr_storage2sockaddr_in6(
+static struct sockaddr_in6* cast_sockaddr_storage2sockaddr_in6(
struct sockaddr_storage* s)
{
return (struct sockaddr_in6*)s;
}
-struct sockaddr_in* cast_sockaddr_storage2sockaddr_in(
+static struct sockaddr_in* cast_sockaddr_storage2sockaddr_in(
struct sockaddr_storage* s)
{
return (struct sockaddr_in*)s;
diff --git a/examples/ldns-testns.c b/examples/ldns-testns.c
index 68a895ad..885453d3 100644
--- a/examples/ldns-testns.c
+++ b/examples/ldns-testns.c
@@ -188,6 +188,7 @@ static void error(const char* msg, ...)
exit(EXIT_FAILURE);
}
+void verbose(int lvl, const char* msg, ...) ATTR_FORMAT(printf, 2, 3);
void verbose(int ATTR_UNUSED(lvl), const char* msg, ...)
{
va_list args;
diff --git a/examples/ldns-testpkts.c b/examples/ldns-testpkts.c
index 1ad20120..cc339790 100644
--- a/examples/ldns-testpkts.c
+++ b/examples/ldns-testpkts.c
@@ -925,7 +925,7 @@ handle_query(uint8_t* inbuf, ssize_t inlen, struct entry* entries, int* count,
}
/** delete the list of reply packets */
-void delete_replylist(struct reply_packet* replist)
+static void delete_replylist(struct reply_packet* replist)
{
struct reply_packet *p=replist, *np;
while(p) {
diff --git a/examples/ldns-verify-zone.c b/examples/ldns-verify-zone.c
index 0bb532fb..8a438cef 100644
--- a/examples/ldns-verify-zone.c
+++ b/examples/ldns-verify-zone.c
@@ -55,7 +55,7 @@ print_type(FILE* stream, ldns_rr_type type)
}
}
-ldns_status
+static ldns_status
read_key_file(const char *filename, ldns_rr_list *keys)
{
ldns_status status = LDNS_STATUS_ERR;
diff --git a/examples/ldns-walk.c b/examples/ldns-walk.c
index da0f74db..d3d91bab 100644
--- a/examples/ldns-walk.c
+++ b/examples/ldns-walk.c
@@ -27,7 +27,7 @@ usage(FILE *fp, char *prog) {
return 0;
}
-ldns_rdf *
+static ldns_rdf *
create_dname_plus_1(ldns_rdf *dname)
{
uint8_t *wire;
@@ -94,7 +94,7 @@ create_dname_plus_1(ldns_rdf *dname)
return newdname;
}
-ldns_rdf *
+static ldns_rdf *
create_plus_1_dname(ldns_rdf *dname)
{
ldns_rdf *label;
@@ -120,7 +120,7 @@ create_plus_1_dname(ldns_rdf *dname)
return label;
}
-ldns_status
+static ldns_status
query_type_bitmaps(ldns_resolver *res,
uint16_t res_flags,
const ldns_rdf *name,
diff --git a/examples/ldnsd.c b/examples/ldnsd.c
index 77c5dd5c..c742f04d 100644
--- a/examples/ldnsd.c
+++ b/examples/ldnsd.c
@@ -30,7 +30,7 @@
#define INBUF_SIZE 4096
-void usage(FILE *output)
+static void usage(FILE *output)
{
fprintf(output, "Usage: ldnsd <address> <port> <zone> <zonefile>\n");
fprintf(output, "Listens on the specified port and answers queries for the given zone\n");
@@ -63,7 +63,7 @@ static int udp_bind(int sock, int port, const char *my_address)
}
/* this will probably be moved to a better place in the library itself */
-ldns_rr_list *
+static ldns_rr_list *
get_rrset(const ldns_zone *zone, const ldns_rdf *owner_name, const ldns_rr_type qtype, const ldns_rr_class qclass)
{
uint16_t i;
diff --git a/host2wire.c b/host2wire.c
index 6c6f1158..4c781236 100644
--- a/host2wire.c
+++ b/host2wire.c
@@ -354,7 +354,7 @@ ldns_hdr2buffer_wire(ldns_buffer *buffer, const ldns_pkt *packet)
return ldns_buffer_status(buffer);
}
-void
+static void
compression_node_free(ldns_rbnode_t *node, void *arg)
{
(void)arg; /* Yes, dear compiler, it is used */