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 <1565380413.21.0.234521569344.issue37801@roundup.psfhosted.org>
In-reply-to
Content
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)
    __MINGW_ATTRIB_DEPRECATED_SEC_WARN;

[1] http://pubs.opengroup.org/onlinepubs/9699919799/functions/wcstok.html
History
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: <1565380413.21.0.234521569344.issue37801@roundup.psfhosted.org>
2019-08-09 19:53:33eryksunlinkissue37801 messages
2019-08-09 19:53:32eryksuncreate