Bug report
Bug description:
There is bug into the declaration of a type for a pointer to function.
At this line there is this declaration:
|
typedef HRESULT (WINAPI *PF_GET_THREAD_DESCRIPTION)(HANDLE, PCWSTR*); |
Unfortunately, this declaration is wrong.
From this page:
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getthreaddescription
this is the correct declaration of the function:
HRESULT GetThreadDescription(
[in] HANDLE hThread,
[out] PWSTR *ppszThreadDescription
);
As you can see, the second parameter is PWSTR and not PCWSTR.
Next, into the code, GetThreadDescription() is called with the right types for the parameters and MSVC seems to tolerate this, but a more strict compiler like GCC does not.
However, this is very simple to fix with a tiny patch.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs
Bug report
Bug description:
There is bug into the declaration of a type for a pointer to function.
At this line there is this declaration:
cpython/Python/traceback.c
Line 74 in 369ce43
Unfortunately, this declaration is wrong.
From this page:
https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-getthreaddescription
this is the correct declaration of the function:
As you can see, the second parameter is
PWSTRand notPCWSTR.Next, into the code,
GetThreadDescription()is called with the right types for the parameters and MSVC seems to tolerate this, but a more strict compiler like GCC does not.However, this is very simple to fix with a tiny patch.
CPython versions tested on:
CPython main branch
Operating systems tested on:
Windows
Linked PRs