Skip to content

Commit 132e31f

Browse files
bpo-43335: Update macro to check gcc version (GH-24662)
(cherry picked from commit bf9de7a) Co-authored-by: Dong-hee Na <donghee.na@python.org>
1 parent 6c4c117 commit 132e31f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Modules/_ctypes/callbacks.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -430,7 +430,7 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
430430
#pragma clang diagnostic push
431431
#pragma clang diagnostic ignored "-Wdeprecated-declarations"
432432
#endif
433-
#if defined(__GNUC__)
433+
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
434434
#pragma GCC diagnostic push
435435
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
436436
#endif
@@ -439,7 +439,7 @@ CThunkObject *_ctypes_alloc_callback(PyObject *callable,
439439
#if defined(__clang__) || defined(MACOSX)
440440
#pragma clang diagnostic pop
441441
#endif
442-
#if defined(__GNUC__)
442+
#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
443443
#pragma GCC diagnostic pop
444444
#endif
445445

0 commit comments

Comments
 (0)