[Python-checkins] Add GCC pragmas to silence compiler warning about ffi_prep_closure (GH-23327) (GH-23590)

pablogsal webhook-mailer at python.org
Tue Dec 1 10:07:59 EST 2020


https://github.com/python/cpython/commit/ae48dd4db53f64f053a6ed6571d083c332d06ff7
commit: ae48dd4db53f64f053a6ed6571d083c332d06ff7
branch: 3.9
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: pablogsal <Pablogsal at gmail.com>
date: 2020-12-01T15:07:50Z
summary:

Add GCC pragmas to silence compiler warning about ffi_prep_closure (GH-23327) (GH-23590)

(cherry picked from commit cce3f0b0c88eba98bc11abe703a444bee7880ff8)

Co-authored-by: Pablo Galindo <Pablogsal at gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal at gmail.com>

files:
M Modules/_ctypes/callbacks.c

diff --git a/Modules/_ctypes/callbacks.c b/Modules/_ctypes/callbacks.c
index 39cace58294d5..19c77f4f57ef5 100644
--- a/Modules/_ctypes/callbacks.c
+++ b/Modules/_ctypes/callbacks.c
@@ -426,15 +426,22 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
         PyErr_Format(PyExc_NotImplementedError, "ffi_prep_closure_loc() is missing");
         goto error;
 #else
-#ifdef MACOSX
+#if defined(__clang__) || defined(MACOSX)
         #pragma clang diagnostic push
         #pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#endif
+#if defined(__GNUC__)
+        #pragma GCC diagnostic push
+        #pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
         result = ffi_prep_closure(p->pcl_write, &p->cif, closure_fcn, p);
 
-#ifdef MACOSX
+#if defined(__clang__) || defined(MACOSX)
         #pragma clang diagnostic pop
 #endif
+#if defined(__GNUC__)
+        #pragma GCC diagnostic pop
+#endif
 
 #endif
     }



More information about the Python-checkins mailing list