Skip to content

gh-93649: Fix linkage of _PyTestCapi_Init_Vectorcall - #94702

Merged
encukou merged 2 commits into
python:mainfrom
arhadthedev:testcapi-inconsistent-linkage
Jul 13, 2022
Merged

encukou merged 2 commits into
python:mainfrom
arhadthedev:testcapi-inconsistent-linkage

Conversation

@arhadthedev

@arhadthedev arhadthedev commented Jul 9, 2022 •

Copy link
Copy Markdown
Member

Addresses this:

##[warning]D:\a\cpython\cpython\Modules_testcapi\vectorcall.c(233,42): warning C4273: '_PyTestCapi_Init_Vectorcall': inconsistent dll linkage [D:\a\cpython\cpython\PCbuild_testcapi.vcxproj]
D:\a\cpython\cpython\Modules_testcapi\parts.h(3,17): message : see previous definition of '_PyTestCapi_Init_Vectorcall' (compiling source file ..\Modules_testcapi\vectorcall.c) [D:\a\cpython\cpython\PCbuild_testcapi.vcxproj]

A follow-up to gh-94549 so cc @encukou.

@arhadthedev

arhadthedev commented Jul 9, 2022 •

Copy link
Copy Markdown
Member Author

Hm...

error C2491: '_PyTestCapi_Init_Vectorcall': definition of dllimport function not allowed

In Python\getargs.c this works perfectly:

PyAPI_FUNC(int)
_PyArg_Parse_SizeT(PyObject *args, const char *format, ...)
{

Do we need to declare such an internal function as importable/exportable?

@arhadthedev

Copy link
Copy Markdown
Member Author

I've made the function non-exportable, now it links with no error.

@encukou encukou added the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 12, 2022
@bedevere-bot

Copy link
Copy Markdown

🤖 New build scheduled with the buildbot fleet by @encukou for commit e0670d6 🤖

If you want to schedule another build, you need to add the ":hammer: test-with-buildbots" label again.

@bedevere-bot bedevere-bot removed the 🔨 test-with-buildbots Test PR w/ buildbots; report in status section label Jul 12, 2022
@encukou
encukou merged commit fc21a43 into python:main Jul 13, 2022
@encukou

encukou commented Jul 13, 2022

Copy link
Copy Markdown
Member

Thank you!

@arhadthedev
arhadthedev deleted the testcapi-inconsistent-linkage branch July 13, 2022 11:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

4 participants