]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix regression introduced by changeset 7c6e3358221a that caused compile
authorNed Deily <nad@acm.org>
Thu, 5 Mar 2015 23:47:10 +0000 (15:47 -0800)
committerNed Deily <nad@acm.org>
Thu, 5 Mar 2015 23:47:10 +0000 (15:47 -0800)
errors of _testcapimodule.c with older versions of gcc.

Modules/_testcapimodule.c

index 08aa9c701ca4cda3ac1d69e8ce0ff6a33059c416..a8ce0dc4eb3b91fdacc026c03124de763c8b5786 100644 (file)
@@ -69,7 +69,7 @@ test_config(PyObject *self)
 static PyObject*
 test_sizeof_c_types(PyObject *self)
 {
-#ifdef __GNUC__
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
 #pragma GCC diagnostic push
 #pragma GCC diagnostic ignored "-Wtype-limits"
 #endif
@@ -130,7 +130,7 @@ test_sizeof_c_types(PyObject *self)
 #undef IS_SIGNED
 #undef CHECK_SIGNESS
 #undef CHECK_SIZEOF
-#ifdef __GNUC__
+#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
 #pragma GCC diagnostic pop
 #endif
 }