[issue37801] Compilation on MINGW64 fails (CODESET,wcstok,...)

Vadim Engelson report at bugs.python.org
Fri Aug 9 07:53:21 EDT 2019


New submission from Vadim Engelson <vadime at wolfram.com>:

Compilation on MINGW64 fails (CODESET,wcstok,...)
I am using the latest MINGW64 (http://repo.msys2.org/distrib/x86_64/msys2-x86_64-20190524.exe)
Versions: Python-3.7.2, Python-3.8.0b3

$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys64\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/9.1.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
gcc version 9.1.0 (Rev3, Built by MSYS2 project)

Result of make:

Python/initconfig.c: In function 'config_get_locale_encoding':
Python/initconfig.c:1427:28: error: implicit declaration of function 'nl_langinfo' [-Werror=implicit-function-declaration]
 1427 |     const char *encoding = nl_langinfo(CODESET);
      |                            ^~~~~~~~~~~
Python/initconfig.c:1427:40: error: 'CODESET' undeclared (first use in this function); did you mean 'ECONNRESET'?
 1427 |     const char *encoding = nl_langinfo(CODESET);
      |                                        ^~~~~~~
      |                                        ECONNRESET
Python/initconfig.c:1427:40: note: each undeclared identifier is reported only once for each function it appears in
Python/initconfig.c: In function 'config_init_env_warnoptions':
Python/initconfig.c:1992:18: error: too many arguments to function 'wcstok'
 1992 | #  define WCSTOK wcstok
      |                  ^~~~~~
Python/initconfig.c:2015:20: note: in expansion of macro 'WCSTOK'
 2015 |     for (warning = WCSTOK(env, L",", &context);
      |                    ^~~~~~
In file included from ./Include/Python.h:30,
                 from Python/initconfig.c:1:
C:/msys64/mingw64/x86_64-w64-mingw32/include/string.h:147:20: note: declared here
  147 |   wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
      |                    ^~~~~~
Python/initconfig.c:1992:18: error: too many arguments to function 'wcstok'
 1992 | #  define WCSTOK wcstok
      |                  ^~~~~~
Python/initconfig.c:2017:20: note: in expansion of macro 'WCSTOK'
 2017 |          warning = WCSTOK(NULL, L",", &context))
      |                    ^~~~~~
In file included from ./Include/Python.h:30,
                 from Python/initconfig.c:1:
C:/msys64/mingw64/x86_64-w64-mingw32/include/string.h:147:20: note: declared here
  147 |   wchar_t *__cdecl wcstok(wchar_t * __restrict__ _Str,const wchar_t * __restrict__ _Delim) __MINGW_ATTRIB_DEPRECATED_SEC_WARN;
      |                    ^~~~~~
cc1.exe: some warnings being treated as errors
make: *** [Makefile:1703: Python/initconfig.o] Error 1

----------
components: Build, Interpreter Core, Windows
messages: 349282
nosy: paul.moore, steve.dower, tim.golden, vengelson, zach.ware
priority: normal
severity: normal
status: open
title: Compilation on MINGW64 fails (CODESET,wcstok,...)
type: compile error
versions: Python 3.7, Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37801>
_______________________________________


More information about the Python-bugs-list mailing list