Remove compiler warnings for obscure combinations of build options.

This commit is contained in:
Simon Kelley
2025-05-24 15:09:53 +01:00
parent ebef27f321
commit 90b248582c
4 changed files with 17 additions and 2 deletions

View File

@@ -64,14 +64,16 @@ int main (int argc, char **argv)
int need_cap_net_raw = 0; int need_cap_net_raw = 0;
int need_cap_net_bind_service = 0; int need_cap_net_bind_service = 0;
int have_cap_chown = 0; int have_cap_chown = 0;
# ifdef HAVE_DHCP
char *bound_device = NULL; char *bound_device = NULL;
int did_bind = 0; int did_bind = 0;
# endif
struct server *serv; struct server *serv;
char *netlink_warn; char *netlink_warn;
#else #else
int bind_fallback = 0; int bind_fallback = 0;
#endif #endif
#if defined(HAVE_DHCP) || defined(HAVE_DHCP6) #if defined(HAVE_DHCP)
struct dhcp_context *context; struct dhcp_context *context;
struct dhcp_relay *relay; struct dhcp_relay *relay;
#endif #endif
@@ -79,6 +81,8 @@ int main (int argc, char **argv)
int tftp_prefix_missing = 0; int tftp_prefix_missing = 0;
#endif #endif
(void)netlink_warn;
#if defined(HAVE_IDN) || defined(HAVE_LIBIDN2) || defined(LOCALEDIR) #if defined(HAVE_IDN) || defined(HAVE_LIBIDN2) || defined(LOCALEDIR)
setlocale(LC_ALL, ""); setlocale(LC_ALL, "");
#endif #endif

View File

@@ -251,6 +251,8 @@ int inotify_check(time_t now)
int hit = 0; int hit = 0;
struct dyndir *dd; struct dyndir *dd;
(void)now;
while (1) while (1)
{ {
int rc; int rc;

View File

@@ -1569,6 +1569,8 @@ void check_servers(int no_loop_check)
int port = 0, count; int port = 0, count;
int locals = 0; int locals = 0;
(void)no_loop_check;
#ifdef HAVE_LOOP #ifdef HAVE_LOOP
if (!no_loop_check) if (!no_loop_check)
loop_send_probes(); loop_send_probes();
@@ -1775,7 +1777,9 @@ int reload_servers(char *fname)
/* Called when addresses are added or deleted from an interface */ /* Called when addresses are added or deleted from an interface */
void newaddress(time_t now) void newaddress(time_t now)
{ {
#ifdef HAVE_DHCP
struct dhcp_relay *relay; struct dhcp_relay *relay;
#endif
(void)now; (void)now;

View File

@@ -214,6 +214,11 @@ static int ubus_handle_set_connmark_allowlist(struct ubus_context *ctx, struct u
struct blob_attr *tb[policy_len]; struct blob_attr *tb[policy_len];
struct blob_attr *attr; struct blob_attr *attr;
(void)ctx;
(void)obj;
(void)req;
(void)method;
if (blobmsg_parse(policy, policy_len, tb, blob_data(msg), blob_len(msg))) if (blobmsg_parse(policy, policy_len, tb, blob_data(msg), blob_len(msg)))
return UBUS_STATUS_INVALID_ARGUMENT; return UBUS_STATUS_INVALID_ARGUMENT;