]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Fix compile warnings without INET or INET6 using gcc.
authorRoy Marples <roy@marples.name>
Sun, 21 Dec 2014 19:00:19 +0000 (19:00 +0000)
committerRoy Marples <roy@marples.name>
Sun, 21 Dec 2014 19:00:19 +0000 (19:00 +0000)
arp.h
dhcp.h
dhcp6.h
if-bsd.c
if-options.c
ipv6.h
ipv6nd.h
script.c

diff --git a/arp.h b/arp.h
index 41c91ee95095fdb6b4d03a2625db055fad54f6b9..71c34676c2a1e39a157378bb1f1953ca2028c207 100644 (file)
--- a/arp.h
+++ b/arp.h
@@ -75,6 +75,6 @@ void arp_free(struct arp_state *);
 void arp_free_but(struct arp_state *);
 void arp_close(struct interface *);
 #else
-#define arp_close(a)
+#define arp_close(a) {}
 #endif
 #endif
diff --git a/dhcp.h b/dhcp.h
index d78ff4f7bda497b6dcf46ac67ea42f3d682ba41b..18a996852168cc1ff564b158d18ca8da651173fe 100644 (file)
--- a/dhcp.h
+++ b/dhcp.h
@@ -290,13 +290,13 @@ void dhcp_close(struct interface *);
 void dhcp_free(struct interface *);
 int dhcp_dump(struct interface *);
 #else
-#define dhcp_drop(a, b)
+#define dhcp_drop(a, b) {}
 #define dhcp_start(a) {}
-#define dhcp_reboot(a, b) b = b
-#define dhcp_reboot_newopts(a, b)
-#define dhcp_close(a)
-#define dhcp_free(a)
-#define dhcp_dump(a) -1
+#define dhcp_reboot(a, b) (b = b)
+#define dhcp_reboot_newopts(a, b) (b = b)
+#define dhcp_close(a) {}
+#define dhcp_free(a) {}
+#define dhcp_dump(a) (-1)
 #endif
 
 #endif
diff --git a/dhcp6.h b/dhcp6.h
index 0e7ee8061f31ceff678fd98fda88e152a8054333..f50af0b6b4d59a9c38edc08e079a6470d88a4ce8 100644 (file)
--- a/dhcp6.h
+++ b/dhcp6.h
@@ -246,13 +246,13 @@ void dhcp6_drop(struct interface *, const char *);
 int dhcp6_dump(struct interface *);
 #else
 #define dhcp6_findaddr(a, b, c) (0)
-#define dhcp6_find_delegates(a)
+#define dhcp6_find_delegates(a) {}
 #define dhcp6_start(a, b) (0)
-#define dhcp6_reboot(a)
-#define dhcp6_env(a, b, c, d, e)
-#define dhcp6_free(a)
+#define dhcp6_reboot(a) {}
+#define dhcp6_env(a, b, c, d, e) {}
+#define dhcp6_free(a) {}
 #define dhcp6_dadcompleted(a) (0)
-#define dhcp6_drop(a, b)
+#define dhcp6_drop(a, b) {}
 #define dhcp6_dump(a) (-1)
 #endif
 
index b61d80c7ffd55759d6bdd8e6f587abae3348ff8a..817c8e1320f390f3af68ba69ecdb2ebc7b94ae15 100644 (file)
--- a/if-bsd.c
+++ b/if-bsd.c
@@ -145,6 +145,7 @@ if_openlinksocket(void)
 #endif
 }
 
+#if defined(INET) || defined(INET6)
 static void
 if_linkaddr(struct sockaddr_dl *sdl, const struct interface *ifp)
 {
@@ -157,6 +158,7 @@ if_linkaddr(struct sockaddr_dl *sdl, const struct interface *ifp)
        link_addr(ifp->name, sdl);
 #endif
 }
+#endif
 
 static int
 if_getssid1(const char *ifname, uint8_t *ssid)
index 898350347caa5be13f7a1988a05098eb30ac61f9..06e3a591ccb4c8fc5a644e00ace09108a0ac60c3 100644 (file)
@@ -526,6 +526,11 @@ set_option_space(struct dhcpcd_ctx *ctx,
     uint8_t *request[], uint8_t *require[], uint8_t *no[])
 {
 
+#if !defined(INET) && !defined(INET6)
+       /* Satisfy use */
+       ctx = ctx;
+#endif
+
 #ifdef INET6
        if (strncmp(arg, "dhcp6_", strlen("dhcp6_")) == 0) {
                *d = ctx->dhcp6_opts;
diff --git a/ipv6.h b/ipv6.h
index ec4102c8adf3e962f39bdf175ca104fd898f6833..8e46ebc2a255bd359e3e2329a696f96119a683e3 100644 (file)
--- a/ipv6.h
+++ b/ipv6.h
@@ -214,11 +214,11 @@ int ipv6_removesubnet(struct interface *, struct ipv6_addr *);
 void ipv6_buildroutes(struct dhcpcd_ctx *);
 
 #else
-#define ipv6_init(a) NULL
+#define ipv6_init(a) (NULL)
 #define ipv6_start(a) (-1)
-#define ipv6_free_ll_callbacks(a)
-#define ipv6_free(a)
-#define ipv6_ctxfree(a)
+#define ipv6_free_ll_callbacks(a) {}
+#define ipv6_free(a) {}
+#define ipv6_ctxfree(a) {}
 #endif
 
 #endif
index 310eb68e60eccc19ef630bc3b08535b32a700d9a..4d1c516c9690b1633a9e84bb9689fe8f667ef60b 100644 (file)
--- a/ipv6nd.h
+++ b/ipv6nd.h
@@ -101,10 +101,10 @@ void ipv6nd_neighbour(struct dhcpcd_ctx *, struct in6_addr *, int);
 #else
 #define ipv6nd_startrs(a) {}
 #define ipv6nd_findaddr(a, b, c) (0)
-#define ipv6nd_free(a)
+#define ipv6nd_free(a) {}
 #define ipv6nd_hasra(a) (0)
 #define ipv6nd_dadcompleted(a) (0)
-#define ipv6nd_drop(a)
+#define ipv6nd_drop(a) {}
 #endif
 
 #endif
index 9a8dd2d4052e8283f54f860a6d3946098b0135f4..fef322ac1b8ff708c5a5b3cb1315f02b99746b11 100644 (file)
--- a/script.c
+++ b/script.c
@@ -229,7 +229,9 @@ make_env(const struct interface *ifp, const char *reason, char ***argv)
 {
        char **env, **nenv, *p;
        size_t e, elen, l;
+#if defined(INET) || defined(INET6)
        ssize_t n;
+#endif
        const struct if_options *ifo = ifp->options;
        const struct interface *ifp2;
 #ifdef INET
@@ -274,7 +276,9 @@ make_env(const struct interface *ifp, const char *reason, char ***argv)
            strcmp(reason, "UNKNOWN") == 0 ||
            strcmp(reason, "DEPARTED") == 0 ||
            strcmp(reason, "STOPPED") == 0)
-               ;
+       {
+               /* This space left intentionally blank */
+       }
 #ifdef INET
        else
                dhcp = 1;