classification
Title: [MinGW] Can't compile Python/dynload_win.c due to static strcasecmp
Type: compile error Stage: patch review
Components: Build, Windows Versions:
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, serhiy.storchaka, steve.dower, tim.golden, vmurashev, zach.ware
Priority: normal Keywords: patch

Created on 2016-09-25 10:48 by vmurashev, last changed 2019-07-13 13:12 by miss-islington.

Files
File name Uploaded Description Edit
dynload_win.c.3.5.mingw.patch vmurashev, 2016-09-25 10:48
dynload_win.c.2.7.mingw.patch vmurashev, 2016-09-25 10:48
Pull Requests
URL Status Linked Edit
PR 13095 merged Minmin.Gong, 2019-05-05 05:20
PR 14740 open miss-islington, 2019-07-13 13:12
PR 14741 open miss-islington, 2019-07-13 13:12
Messages (3)
msg277362 - (view) Author: Vitaly Murashev (vmurashev) * Date: 2016-09-25 10:48
Attempt to complile Python/dynload_win.c by MinGW fails
due to static reimplementation of strcasecmp function in this file:

---
/* Case insensitive string compare, to avoid any dependencies on particular
   C RTL implementations */

static int strcasecmp (char *string1, char *string2)
{
    int first, second;

    do {
        first  = tolower(*string1);
        second = tolower(*string2);
        string1++;
        string2++;
    } while (first && first == second);

    return (first - second);
}
---

And this reimplementation clashed with native declaration of strcasecmp()
which one is a part of MinGW runtime

So suggested patch (for 3.5.2 and 2.7.12)
just disables static reimplementation of strcasecmp for MinGW
msg277761 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-30 16:37
Why not replace it entirely with stricmp? Does it behave differently?
msg347812 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2019-07-13 13:11
New changeset 05f2d84cae4ba1ff15b7a1d0347305393f4bdcc5 by Serhiy Storchaka (Minmin Gong) in branch 'master':
bpo-28269: Replace strcasecmp with system function _stricmp. (GH-13095)
https://github.com/python/cpython/commit/05f2d84cae4ba1ff15b7a1d0347305393f4bdcc5
History
Date User Action Args
2019-07-13 13:12:09miss-islingtonsetpull_requests: + pull_request14537
2019-07-13 13:12:01miss-islingtonsetpull_requests: + pull_request14536
2019-07-13 13:11:46serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg347812
2019-05-05 05:20:04Minmin.Gongsetstage: patch review
pull_requests: + pull_request13009
2016-09-30 16:37:19steve.dowersetnosy: + paul.moore, tim.golden, zach.ware, steve.dower
messages: + msg277761
components: + Windows
2016-09-25 11:27:58martin.panterlinkissue10504 dependencies
2016-09-25 11:25:56vmurashevsettype: compile error
2016-09-25 10:48:18vmurashevsetfiles: + dynload_win.c.2.7.mingw.patch
2016-09-25 10:48:03vmurashevcreate