classification
Title: _ctypes/callbacks.c cannot be compiled by gcc 4.4.7 (RHEL6)
Type: compile error Stage: resolved
Components: ctypes Versions: Python 3.10, Python 3.9
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: corona10, dvilleneuve, miss-islington
Priority: normal Keywords: patch

Created on 2021-02-26 23:28 by dvilleneuve, last changed 2021-02-28 00:52 by corona10. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 24662 merged corona10, 2021-02-27 06:59
PR 24665 merged miss-islington, 2021-02-28 00:16
Messages (6)
msg387755 - (view) Author: DANIEL VILLENEUVE (dvilleneuve) Date: 2021-02-26 23:28
gcc 4.4.7 does not accept #pragma's inside functions.
I made the following patch, inspired by code found in other Python source files.

diff -r U/Python-3.9.2/Modules/_ctypes/callbacks.c V/Python-3.9.2/Modules/_ctypes/callbacks.c
433c433
< #if defined(__GNUC__)
---
> #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))
442c442
< #if defined(__GNUC__)
---
> #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 5)))

Regards
msg387770 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2021-02-27 07:01
@Daniel

Do you want to submit the patch?
msg387779 - (view) Author: DANIEL VILLENEUVE (dvilleneuve) Date: 2021-02-27 17:10
I'll let you do so if it's ok for you, since I'm not equipped with Python dev tools.

Regards
msg387798 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2021-02-28 00:16
New changeset bf9de7ab24d9d7068645b202bc47146b9a4f2726 by Dong-hee Na in branch 'master':
bpo-43335: Update macro to check gcc version (GH-24662)
https://github.com/python/cpython/commit/bf9de7ab24d9d7068645b202bc47146b9a4f2726
msg387799 - (view) Author: miss-islington (miss-islington) Date: 2021-02-28 00:51
New changeset 132e31f4bf20818a469cbcdba75068f26cb19a65 by Miss Islington (bot) in branch '3.9':
bpo-43335: Update macro to check gcc version (GH-24662)
https://github.com/python/cpython/commit/132e31f4bf20818a469cbcdba75068f26cb19a65
msg387800 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2021-02-28 00:52
Thank you Daniel for reporting and suggestion!
History
Date User Action Args
2021-02-28 00:52:47corona10setstatus: open -> closed
resolution: fixed
messages: + msg387800

stage: patch review -> resolved
2021-02-28 00:51:43miss-islingtonsetmessages: + msg387799
2021-02-28 00:20:22corona10setversions: + Python 3.10
2021-02-28 00:16:52miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request23451
2021-02-28 00:16:32corona10setmessages: + msg387798
2021-02-27 17:10:38dvilleneuvesetmessages: + msg387779
2021-02-27 07:01:52corona10setmessages: + msg387770
2021-02-27 06:59:43corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request23448
2021-02-27 06:53:48corona10setnosy: + corona10
2021-02-26 23:28:21dvilleneuvecreate