Title: [3.12] `extern "C"` not closed in tracemalloc.h when using Py_LIMITED_API · Issue #127902 · python/cpython · GitHub
Open Graph Title: [3.12] `extern "C"` not closed in tracemalloc.h when using Py_LIMITED_API · Issue #127902 · python/cpython
X Title: [3.12] `extern "C"` not closed in tracemalloc.h when using Py_LIMITED_API · Issue #127902 · python/cpython
Description: Bug report Bug description: When building PyQt6 with the latest 3.12 branch, I get the following error: g++ -c -pipe -g -O2 -ffile-prefix-map=/pyqt6=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fc...
Open Graph Description: Bug report Bug description: When building PyQt6 with the latest 3.12 branch, I get the following error: g++ -c -pipe -g -O2 -ffile-prefix-map=/pyqt6=. -fstack-protector-strong -fstack-clash-protect...
X Description: Bug report Bug description: When building PyQt6 with the latest 3.12 branch, I get the following error: g++ -c -pipe -g -O2 -ffile-prefix-map=/pyqt6=. -fstack-protector-strong -fstack-clash-protect...
Opengraph URL: https://github.com/python/cpython/issues/127902
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[3.12] `extern \"C\"` not closed in tracemalloc.h when using Py_LIMITED_API","articleBody":"# Bug report\n\n### Bug description:\n\nWhen building PyQt6 with the latest 3.12 branch, I get the following error:\n\n```\ng++ -c -pipe -g -O2 -ffile-prefix-map=/pyqt6=. -fstack-protector-strong -fstack-clash-protection -Wformat -Werror=format-security -fcf-protection -Wdate-time -D_FORTIFY_SOURCE=2 -O2 -fno-exceptions -Wall -Wextra -D_REENTRANT -fPIC -DPy_LIMITED_API=0x03090000 -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_PLUGIN -DQT_CORE_LIB -I. -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include -I/usr/include/python3.12 -I/usr/include/x86_64-linux-gnu/qt6 -I/usr/include/x86_64-linux-gnu/qt6/QtCore -I. -I/usr/lib/x86_64-linux-gnu/qt6/mkspecs/linux-g++ -o dbus.o ../../../../dbus/dbus.cpp\nIn file included from /usr/include/c++/14/utility:68,\n from /usr/include/x86_64-linux-gnu/qt6/QtCore/qglobal.h:15,\n from /usr/include/x86_64-linux-gnu/qt6/QtCore/qcoreapplication.h:7,\n from /usr/include/x86_64-linux-gnu/qt6/QtCore/QCoreApplication:1,\n from ../../../../dbus/dbus.cpp:29:\n/usr/include/c++/14/bits/stl_relops.h:86:5: error: template with C linkage\n 86 | template \u003cclass _Tp>\n | ^~~~~~~~\nIn file included from /usr/include/python3.12/Python.h:107,\n from /usr/include/dbus-1.0/dbus/dbus-python.h:34,\n from ../../../../dbus/dbus.cpp:27:\n/usr/include/python3.12/tracemalloc.h:4:1: note: ‘extern \"C\"’ linkage started here\n 4 | extern \"C\" {\n | ^~~~~~~~~~\n```\n\nThis happened because of the commit 65bca19db54eb765, which changed the structure of `tracemalloc.h` to the following:\n\n```c++\n#ifndef Py_TRACEMALLOC_H\n#define Py_TRACEMALLOC_H\n#ifdef __cplusplus\nextern \"C\" {\n#endif\n\n#ifndef Py_LIMITED_API\n/* ... */\n\n#ifdef __cplusplus\n}\n#endif\n#endif /* !Py_LIMITED_API */\n#endif /* !Py_TRACEMALLOC_H */\n```\n\nHere, if `Py_LIMITED_API` is defined, the `extern \"C\"` block is opened but never closed.\n\nThis problem does not affect 3.13 and newer versions, because the order is different there. I am going to submit a trivial pull request to fix this.\n\n### CPython versions tested on:\n\n3.12\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-127904\n* gh-127912\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/mitya57","@type":"Person","name":"mitya57"},"datePublished":"2024-12-13T10:55:55Z","url":"https://github.com/python/cpython/issues/127902"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e6c9c9f9-1355-ba13-90da-09aa0112c0df |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8652:76F02:434894D:55E26CD:6B022F49 |
| html-safe-nonce | a1668cc5fc077e5666b0c2288d6246429e46113d4d46dd4c10435b53ff449c54 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjUyOjc2RjAyOjQzNDg5NEQ6NTVFMjZDRDo2QjAyMkY0OSIsInZpc2l0b3JfaWQiOiI4NTM0MDkwMzA4MDI2MjQ5MDMzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 48e1d7347431b66dc4c0a541dc655da4988a02ae17e37326d7494fa8c6825b1f |
| hovercard-subject-tag | issue:2738116390 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/127902/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c282ddd85207b396fc69c197ac5539ff182ab78390c614fdc324275bb4350a77/python/cpython/issues/127902 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c282ddd85207b396fc69c197ac5539ff182ab78390c614fdc324275bb4350a77/python/cpython/issues/127902 |
| og:image:alt | Bug report Bug description: When building PyQt6 with the latest 3.12 branch, I get the following error: g++ -c -pipe -g -O2 -ffile-prefix-map=/pyqt6=. -fstack-protector-strong -fstack-clash-protect... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | mitya57 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456 |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 423dbb54c5e7bfecc838eb387c1435eb3d0e760d |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width