From: Yann Ylavic Date: Tue, 20 Mar 2018 22:39:48 +0000 (+0000) Subject: #pragma GCC diagnostic push/pop exist in gcc >= 4.6 only. X-Git-Tag: 2.5.0-alpha2-ci-test-only~2768 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c42ef535782160c9ea42d9cee6e13c0cedd8794f;p=thirdparty%2Fapache%2Fhttpd.git #pragma GCC diagnostic push/pop exist in gcc >= 4.6 only. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1827372 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/modules/md/md_json.c b/modules/md/md_json.c index 25c5895c4fe..fed9d5de59a 100644 --- a/modules/md/md_json.c +++ b/modules/md/md_json.c @@ -28,10 +28,11 @@ * when undefining their INLINEs, we get static, unused functions, arg */ #if defined(__GNUC__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) #pragma GCC diagnostic push -#pragma GCC diagnostic ignored "-Wunreachable-code" #endif -#if defined(__clang__) +#pragma GCC diagnostic ignored "-Wunreachable-code" +#elif defined(__clang__) #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-function" #endif @@ -42,9 +43,10 @@ #include #if defined(__GNUC__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) #pragma GCC diagnostic pop #endif -#if defined(__clang__) +#elif defined(__clang__) #pragma clang diagnostic pop #endif diff --git a/test/httpdunit.h b/test/httpdunit.h index d858417bcb0..8c76d434a22 100644 --- a/test/httpdunit.h +++ b/test/httpdunit.h @@ -36,7 +36,9 @@ #include "apr.h" /* for pid_t on Windows, needed by Check */ #if defined(__GNUC__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) #pragma GCC diagnostic push +#endif #pragma GCC diagnostic ignored "-Wstrict-prototypes" #elif defined(__clang__) #pragma clang diagnostic push @@ -46,7 +48,9 @@ #include "check.h" #if defined(__GNUC__) +#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) #pragma GCC diagnostic pop +#endif #elif defined(__clang__) #pragma clang diagnostic pop #endif