Title: PyTuple_SET_ITEM fails to compile in C++ source · Issue #93442 · python/cpython · GitHub
Open Graph Title: PyTuple_SET_ITEM fails to compile in C++ source · Issue #93442 · python/cpython
X Title: PyTuple_SET_ITEM fails to compile in C++ source · Issue #93442 · python/cpython
Description: CPython versions tested on: 3.11b3 Operating system and architecture: Debian Linux, GCC 10.2.1-6 The kiwisolver extension doesn't compile with beta 3. The error is: /usr/local/python3.11.0b3/include/python3.11/pyport.h:47:24: error: inva...
Open Graph Description: CPython versions tested on: 3.11b3 Operating system and architecture: Debian Linux, GCC 10.2.1-6 The kiwisolver extension doesn't compile with beta 3. The error is: /usr/local/python3.11.0b3/includ...
X Description: CPython versions tested on: 3.11b3 Operating system and architecture: Debian Linux, GCC 10.2.1-6 The kiwisolver extension doesn't compile with beta 3. The error is: /usr/local/python3.11.0b3/in...
Opengraph URL: https://github.com/python/cpython/issues/93442
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"PyTuple_SET_ITEM fails to compile in C++ source","articleBody":"- CPython versions tested on: 3.11b3\r\n- Operating system and architecture: Debian Linux, GCC 10.2.1-6\r\n\r\nThe kiwisolver extension doesn't compile with beta 3. The error is:\r\n```\r\n/usr/local/python3.11.0b3/include/python3.11/pyport.h:47:24: error: invalid ‘static_cast’ from type ‘int’ to type ‘_object*’\r\n 47 | return static_cast\u003ctype\u003e(const_cast\u003cexpr_type \u0026\u003e(expr));\r\n | ^~~~~\r\n```\r\n\r\nThis seems to be an issue with the new inline functions for things that used to be macros. E.g. PyTuple_SET_ITEM. The C++ code triggering the issue is:\r\n```\r\n--- a/py/src/symbolics.h\r\n+++ b/py/src/symbolics.h\r\n@@ -123,7 +123,7 @@ PyObject* BinaryMul::operator()( Expression* first, double second )\r\n return 0;\r\n Py_ssize_t end = PyTuple_GET_SIZE( first-\u003eterms );\r\n for( Py_ssize_t i = 0; i \u003c end; ++i ) // memset 0 for safe error return\r\n- PyTuple_SET_ITEM( terms.get(), i, 0 );\r\n+ PyTuple_SetItem( terms.get(), i, 0 );\r\n for( Py_ssize_t i = 0; i \u003c end; ++i )\r\n {\r\n PyObject* item = PyTuple_GET_ITEM( first-\u003eterms, i );\r\n```\r\n\r\nReplacing the macro with the function version seems to allow the extension to compile.\r\n\r\nThis seems related to https://github.com/python/cpython/issues/92898","author":{"url":"https://github.com/nascheme","@type":"Person","name":"nascheme"},"datePublished":"2022-06-02T20:58:40.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":9},"url":"https://github.com/93442/cpython/issues/93442"}
| 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:278a0fc5-091b-b4b4-4517-3d9c37d5f1ab |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8A5E:EE905:172B76:1F5BA3:696967AA |
| html-safe-nonce | 6e55028cb43ce8f06f1998c93786097624cfab845c564c8ac75f93dd589f4b00 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QTVFOkVFOTA1OjE3MkI3NjoxRjVCQTM6Njk2OTY3QUEiLCJ2aXNpdG9yX2lkIjoiNzEzNjUwODMyMzU0MzIxMzk5NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 41aba3c3450294a2d43a9a66f4c7bd6c2d1d47412ab7afb764477fea6360f2d2 |
| hovercard-subject-tag | issue:1258713113 |
| 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/93442/issue_layout |
| twitter:image | https://opengraph.githubassets.com/669cd7d52608c0336492d315f75d101f56ce790f2ae6c066db4f0364afa31aee/python/cpython/issues/93442 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/669cd7d52608c0336492d315f75d101f56ce790f2ae6c066db4f0364afa31aee/python/cpython/issues/93442 |
| og:image:alt | CPython versions tested on: 3.11b3 Operating system and architecture: Debian Linux, GCC 10.2.1-6 The kiwisolver extension doesn't compile with beta 3. The error is: /usr/local/python3.11.0b3/includ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | nascheme |
| hostname | github.com |
| expected-hostname | github.com |
| None | c6f193beb8ff08443adc07685d75302ab8aaf0a135f6e251c3ff3112c8deb881 |
| 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 | ec4d88fbe7ed62446d90b0a6d8e6db4248a8f8b8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width