diff options
author | Jan Moskyto Matejka <mq@ucw.cz> | 2016-10-14 15:37:04 +0200 |
---|---|---|
committer | Ondrej Zajicek (work) <santiago@crfreenet.org> | 2016-11-01 14:52:54 +0100 |
commit | 3e236955c9369475872b9b86a58502fa777b50b9 (patch) | |
tree | d43b519c2289a353e56c32b42c402f9fa12d0e13 /sysdep/unix | |
parent | 17fe57d8dcc89aea520788914b252cf49cf060ff (diff) |
Build: switch on -Wextra, get rid of most of the warnings
There are several unresolved -Wmissing-field-initializers on older
versions of GCC than 5.1, all of them false positive.
Diffstat (limited to 'sysdep/unix')
-rw-r--r-- | sysdep/unix/io.c | 12 | ||||
-rw-r--r-- | sysdep/unix/krt.c | 4 | ||||
-rw-r--r-- | sysdep/unix/main.c | 6 | ||||
-rw-r--r-- | sysdep/unix/unix.h | 10 |
4 files changed, 16 insertions, 16 deletions
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c index 3ceadd98..873b5805 100644 --- a/sysdep/unix/io.c +++ b/sysdep/unix/io.c @@ -507,11 +507,11 @@ tm_format_datetime(char *x, struct timeformat *fmt_spec, bird_clock_t t) * Sockaddr helper functions */ -static inline int sockaddr_length(int af) +static inline int UNUSED sockaddr_length(int af) { return (af == AF_INET) ? sizeof(struct sockaddr_in) : sizeof(struct sockaddr_in6); } static inline void -sockaddr_fill4(struct sockaddr_in *sa, ip_addr a, struct iface *ifa, uint port) +sockaddr_fill4(struct sockaddr_in *sa, ip_addr a, uint port) { memset(sa, 0, sizeof(struct sockaddr_in)); #ifdef HAVE_SIN_LEN @@ -542,7 +542,7 @@ void sockaddr_fill(sockaddr *sa, int af, ip_addr a, struct iface *ifa, uint port) { if (af == AF_INET) - sockaddr_fill4((struct sockaddr_in *) sa, a, ifa, port); + sockaddr_fill4((struct sockaddr_in *) sa, a, port); else if (af == AF_INET6) sockaddr_fill6((struct sockaddr_in6 *) sa, a, ifa, port); else @@ -550,7 +550,7 @@ sockaddr_fill(sockaddr *sa, int af, ip_addr a, struct iface *ifa, uint port) } static inline void -sockaddr_read4(struct sockaddr_in *sa, ip_addr *a, struct iface **ifa, uint *port) +sockaddr_read4(struct sockaddr_in *sa, ip_addr *a, uint *port) { *port = ntohs(sa->sin_port); *a = ipa_from_in4(sa->sin_addr); @@ -573,7 +573,7 @@ sockaddr_read(sockaddr *sa, int af, ip_addr *a, struct iface **ifa, uint *port) goto fail; if (af == AF_INET) - sockaddr_read4((struct sockaddr_in *) sa, a, ifa, port); + sockaddr_read4((struct sockaddr_in *) sa, a, port); else if (af == AF_INET6) sockaddr_read6((struct sockaddr_in6 *) sa, a, ifa, port); else @@ -770,7 +770,7 @@ sk_set_tos6(sock *s, int tos) } static inline int -sk_set_high_port(sock *s) +sk_set_high_port(sock *s UNUSED) { /* Port range setting is optional, ignore it if not supported */ diff --git a/sysdep/unix/krt.c b/sysdep/unix/krt.c index ef98cb3a..07a55c0d 100644 --- a/sysdep/unix/krt.c +++ b/sysdep/unix/krt.c @@ -909,7 +909,7 @@ krt_scan_timer_start(struct krt_proto *p) } static void -krt_scan_timer_stop(struct krt_proto *p) +krt_scan_timer_stop(struct krt_proto *p UNUSED) { krt_scan_count--; @@ -998,7 +998,7 @@ krt_store_tmp_attrs(rte *rt, struct ea_list *attrs) } static int -krt_import_control(struct proto *P, rte **new, ea_list **attrs, struct linpool *pool) +krt_import_control(struct proto *P, rte **new, ea_list **attrs UNUSED, struct linpool *pool UNUSED) { struct krt_proto *p = (struct krt_proto *) P; rte *e = *new; diff --git a/sysdep/unix/main.c b/sysdep/unix/main.c index a7989920..35bc3fd1 100644 --- a/sysdep/unix/main.c +++ b/sysdep/unix/main.c @@ -73,7 +73,7 @@ async_dump(void) #else static inline void -drop_uid(uid_t uid) +drop_uid(uid_t uid UNUSED) { die("Cannot change user on this platform"); } @@ -419,7 +419,7 @@ cli_get_command(cli *c) } static int -cli_rx(sock *s, int size UNUSED) +cli_rx(sock *s, uint size UNUSED) { cli_kick(s->data); return 0; @@ -439,7 +439,7 @@ cli_err(sock *s, int err) } static int -cli_connect(sock *s, int size UNUSED) +cli_connect(sock *s, uint size UNUSED) { cli *c; diff --git a/sysdep/unix/unix.h b/sysdep/unix/unix.h index 4e0ff841..3ef2e3ef 100644 --- a/sysdep/unix/unix.h +++ b/sysdep/unix/unix.h @@ -63,16 +63,16 @@ typedef struct sockaddr_bird { #endif -static inline ip_addr ipa_from_in4(struct in_addr a) +static inline ip_addr ipa_from_in4(struct in_addr a UNUSED6) { return ipa_from_u32(ntohl(a.s_addr)); } -static inline ip_addr ipa_from_in6(struct in6_addr a) +static inline ip_addr ipa_from_in6(struct in6_addr a UNUSED4) { return ipa_build6(ntohl(a.s6_addr32[0]), ntohl(a.s6_addr32[1]), ntohl(a.s6_addr32[2]), ntohl(a.s6_addr32[3])); } -static inline ip_addr ipa_from_sa4(sockaddr *sa) +static inline ip_addr ipa_from_sa4(sockaddr *sa UNUSED6) { return ipa_from_in4(((struct sockaddr_in *) sa)->sin_addr); } -static inline ip_addr ipa_from_sa6(sockaddr *sa) +static inline ip_addr ipa_from_sa6(sockaddr *sa UNUSED4) { return ipa_from_in6(((struct sockaddr_in6 *) sa)->sin6_addr); } static inline struct in_addr ipa_to_in4(ip_addr a) @@ -83,7 +83,7 @@ static inline struct in6_addr ipa_to_in6(ip_addr a) { return (struct in6_addr) { .s6_addr32 = { htonl(_I0(a)), htonl(_I1(a)), htonl(_I2(a)), htonl(_I3(a)) } }; } #else /* Temporary dummy */ -static inline struct in6_addr ipa_to_in6(ip_addr a) +static inline struct in6_addr ipa_to_in6(ip_addr a UNUSED) { return (struct in6_addr) { .s6_addr32 = { 0, 0, 0, 0 } }; } #endif |