Title: Can't include Python.h from C++ code on macOS Sonoma / Clang 15 · Issue #110845 · python/cpython · GitHub
Open Graph Title: Can't include Python.h from C++ code on macOS Sonoma / Clang 15 · Issue #110845 · python/cpython
X Title: Can't include Python.h from C++ code on macOS Sonoma / Clang 15 · Issue #110845 · python/cpython
Description: Bug report Bug description: Including Python.h on <3.13 from a .cpp file results in the following: In file included from include/python3.11/Python.h:50: include/python3.11/bytesobject.h:10:1: error: import of C++ module 'Darwin.C.stdarg'...
Open Graph Description: Bug report Bug description: Including Python.h on <3.13 from a .cpp file results in the following: In file included from include/python3.11/Python.h:50: include/python3.11/bytesobject.h:10:1: error...
X Description: Bug report Bug description: Including Python.h on <3.13 from a .cpp file results in the following: In file included from include/python3.11/Python.h:50: include/python3.11/bytesobject.h:10:1: er...
Opengraph URL: https://github.com/python/cpython/issues/110845
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Can't include Python.h from C++ code on macOS Sonoma / Clang 15","articleBody":"# Bug report\n\n### Bug description:\n\nIncluding Python.h on \u003c3.13 from a .cpp file results in the following:\n\n```\nIn file included from include/python3.11/Python.h:50:\ninclude/python3.11/bytesobject.h:10:1: error: import of C++ module 'Darwin.C.stdarg' appears within extern \"C\" language linkage specification [-Wmodule-import-in-extern-c]\n```\n\nYou can work around this on a per project basis with `-Wno-module-import-in-extern-c`, but that's still pretty annoying.\n\nThis is due to an include of a system header from inside an `extern \"C\"` block, which LLVM doesn't seem to like anymore with default flags on macOS.\n\nI believe the changes related to https://github.com/python/cpython/pull/108769 will fix this. Can we get them backported?\n\n### CPython versions tested on:\n\n3.11, 3.12\n\n### Operating systems tested on:\n\nmacOS","author":{"url":"https://github.com/lunixbochs","@type":"Person","name":"lunixbochs"},"datePublished":"2023-10-13T21:05:51.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":11},"url":"https://github.com/110845/cpython/issues/110845"}
| 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:f79c08ee-775f-c558-fe8b-f6c3da32a548 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 8AFA:19325D:C245D:100AAB:696AD1B8 |
| html-safe-nonce | 67638c0790958fbdac2b08ea10cb25bda21469720c54040a1ca3f9aec6c83015 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4QUZBOjE5MzI1RDpDMjQ1RDoxMDBBQUI6Njk2QUQxQjgiLCJ2aXNpdG9yX2lkIjoiODg1NjE3NjI1Nzc4MzIyMjcxMiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | e0350dcdd84d35e9c3ad747a162046f0b53b288a84dc6c723b843481b6accc12 |
| hovercard-subject-tag | issue:1942641520 |
| 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/110845/issue_layout |
| twitter:image | https://opengraph.githubassets.com/aac85c67550aac2fd1d8cd9986cabed79236ce7c20a2a3b1a2922e553283980a/python/cpython/issues/110845 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/aac85c67550aac2fd1d8cd9986cabed79236ce7c20a2a3b1a2922e553283980a/python/cpython/issues/110845 |
| og:image:alt | Bug report Bug description: Including Python.h on <3.13 from a .cpp file results in the following: In file included from include/python3.11/Python.h:50: include/python3.11/bytesobject.h:10:1: error... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | lunixbochs |
| hostname | github.com |
| expected-hostname | github.com |
| None | c785f4ce187e9e7331257791b36ddee01625bb8e292a9b4fe2c16d4c006abf5d |
| 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 | c718a376fcf780eb22089171adb84a543f660bf7 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width