]> granicus.if.org Git - python/commitdiff
Fix "GCC diagnostic" in socketmodule.c
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 5 Mar 2015 13:04:03 +0000 (14:04 +0100)
committerVictor Stinner <victor.stinner@gmail.com>
Thu, 5 Mar 2015 13:04:03 +0000 (14:04 +0100)
Fix regression of changeset 7c6e3358221a on GCC < 4.4. The _socket module
cannot be compiled on "x86 FreeBSD 7.2 3.x" buildbot anymore.

Modules/socketmodule.c

index 4eb3978bec80ae87a6878fd3995c213e84bbf214..483dae546add45042df4dc2e8cf5d28f2055cd8d 100644 (file)
@@ -1966,13 +1966,13 @@ cmsg_min_space(struct msghdr *msg, struct cmsghdr *cmsgh, size_t space)
     #pragma clang diagnostic push
     #pragma clang diagnostic ignored "-Wtautological-compare"
     #endif
-    #ifdef __GNUC__
+    #if defined(__GNUC__) && ((__GNUC__ == 4) || ((__GNUC__ > 4) && (__GNUC_MINOR__ > 5)))
     #pragma GCC diagnostic push
     #pragma GCC diagnostic ignored "-Wtype-limits"
     #endif
     if (msg->msg_controllen < 0)
         return 0;
-    #ifdef __GNUC__
+    #if defined(__GNUC__) && ((__GNUC__ == 4) || ((__GNUC__ > 4) && (__GNUC_MINOR__ > 5)))
     #pragma GCC diagnostic pop
     #endif
     #ifdef __clang__