]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Only use GCC pragma is GCC is 4.6 or newer for push/pop support.
authorRoy Marples <roy@marples.name>
Mon, 26 Oct 2015 10:47:33 +0000 (10:47 +0000)
committerRoy Marples <roy@marples.name>
Mon, 26 Oct 2015 10:47:33 +0000 (10:47 +0000)
common.c

index 4f9160b55e4e7c74b61cbd4961503720a2ba4d93..f5bae1378c9d5709b66d899b540649e7ee0c207b 100644 (file)
--- 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,