]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
gcc: Compile with older GCC again.
authorRoy Marples <roy@marples.name>
Tue, 1 Oct 2019 16:21:00 +0000 (17:21 +0100)
committerRoy Marples <roy@marples.name>
Tue, 1 Oct 2019 16:21:00 +0000 (17:21 +0100)
src/arp.c
src/common.h

index 49393f5a528aa6bec75c88cd30f7e9f8daef9db6..c9c84f5618d0375b06e39bf0a92fbc83cfcb7e06 100644 (file)
--- a/src/arp.c
+++ b/src/arp.c
@@ -142,11 +142,15 @@ arp_found(struct arp_state *astate, const struct arp_msg *amsg)
        arp_report_conflicted(astate, amsg);
        ifp = astate->iface;
 
+#ifdef GCC_PRAGMA_GCC
 #pragma GCC diagnostic push /* GCC is clearly wrong about this warning. */
 #pragma GCC diagnostic ignored "-Wincompatible-pointer-types"
+#endif
        /* If we haven't added the address we're doing a probe. */
        ia = ipv4_iffindaddr(ifp, &astate->addr, NULL);
+#ifdef GCC_PRAGMA_GCC
 #pragma GCC diagnostic pop
+#endif
        if (ia == NULL) {
                if (astate->found_cb != NULL)
                        astate->found_cb(astate, amsg);
index 4e8bcdead667a67b1a5ef7fd091d035837996533..bef56958a03dda45ec1dfd5df1978e4d4451acb2 100644 (file)
 # endif
 #endif
 
+/* Older GCC does not support pragma GCC. */
+#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5))
+#define GCC_PRAGMA_GCC
+#endif
+
 void get_line_free(void);
 extern int clock_monotonic;
 int get_monotonic(struct timespec *);