Author eryksun
Recipients eamanu, eryksun, paul.moore, steve.dower, tim.golden, vengelson, zach.ware
Date 2019-08-09.19:53:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
I wasn't aware that CPython builds for MSYS2 out of the box, since it's a POSIX-on-Windows platform like Cygwin. Apparently there are patches that enable it to build, since MSYS2 has Python available.

For Windows, WCSTOK expands to wcstok_s, which takes a context pointer that allows concurrently parsing multiple strings in a single thread. The old function lacks this parameter and instead uses a per-thread static buffer. They're declared as follows:

    wchar_t *wcstok(wchar_t *strToken, const wchar_t *strDelimit);
    wchar_t *wcstok_s(wchar_t *str, const wchar_t *delimiters,
                      wchar_t **context);

Otherwise the WCSTOK macro expands to wcstok, which assumes that POSIX systems use the standard definition [1]:

    wchar_t *wcstok(wchar_t *restrict ws1, const wchar_t *restrict ws2,
                    wchar_t **restrict ptr);

Apparently the version of wcstok declared in your build environment takes only two arguments, like the old insecure function in Windows: 

    wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,
                            const wchar_t * __restrict__ _Delim)

Date User Action Args
2019-08-09 19:53:33eryksunsetrecipients: + eryksun, paul.moore, tim.golden, zach.ware, steve.dower, eamanu, vengelson
2019-08-09 19:53:33eryksunsetmessageid: <>
2019-08-09 19:53:33eryksunlinkissue37801 messages
2019-08-09 19:53:32eryksuncreate