From: Roy Marples Date: Mon, 26 Oct 2015 10:47:33 +0000 (+0000) Subject: Only use GCC pragma is GCC is 4.6 or newer for push/pop support. X-Git-Tag: v6.9.4~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3f1e061b152521beeedbb183720bf628518fcab0;p=thirdparty%2Fdhcpcd.git Only use GCC pragma is GCC is 4.6 or newer for push/pop support. --- diff --git a/common.c b/common.c index 4f9160b5..f5bae137 100644 --- a/common.c +++ b/common.c @@ -123,8 +123,10 @@ logger_close(struct dhcpcd_ctx *ctx) * Until NetBSD solves this issue, we have to disable a gcc diagnostic * for our fully standards compliant code in the logger function. */ +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wmissing-format-attribute" +#endif void logger(struct dhcpcd_ctx *ctx, int pri, const char *fmt, ...) { @@ -222,7 +224,9 @@ logger(struct dhcpcd_ctx *ctx, int pri, const char *fmt, ...) va_end(va); } #endif +#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 5)) #pragma GCC diagnostic pop +#endif ssize_t setvar(struct dhcpcd_ctx *ctx,