From 177c67d45de4496a0032472f178355c65d55abfb Mon Sep 17 00:00:00 2001 From: Roy Marples Date: Tue, 1 Oct 2019 17:21:00 +0100 Subject: [PATCH] gcc: Compile with older GCC again. --- src/arp.c | 4 ++++ src/common.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/arp.c b/src/arp.c index 49393f5a..c9c84f56 100644 --- 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); diff --git a/src/common.h b/src/common.h index 4e8bcdea..bef56958 100644 --- a/src/common.h +++ b/src/common.h @@ -190,6 +190,11 @@ # 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 *); -- 2.47.2