Skip to content

windows: usage of deprecated std:wstring_convert #32361

@fanquake

Description

@fanquake

std:wstring_convert was deprecated in C++17 & is removed in C++26.
Cross-compiling for Windows with GCC 15.1.0 is warning about this:

../../src/common/system.cpp: In function 'void runCommand(const std::string&)':
../../src/common/system.cpp:52:32: warning: 'template<class _Codecvt, class _Elem, class _Wide_alloc, class _Byte_alloc> class std::__cxx11::wstring_convert' is deprecated [-Wdeprecated-declarations]
   52 |     int nErr = ::_wsystem(std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>,wchar_t>().from_bytes(strCommand).c_str());
      |                                ^~~~~~~~~~~~~~~
In file included from /opt/homebrew/Cellar/mingw-w64/12.0.0_3/toolchain-x86_64/x86_64-w64-mingw32/include/c++/15.1.0/locale:47,
                 from ../../src/util/string.h:13,
                 from ../../src/tinyformat.h:149,
                 from ../../src/logging.h:10,
                 from ../../src/common/system.cpp:10:
/opt/homebrew/Cellar/mingw-w64/12.0.0_3/toolchain-x86_64/x86_64-w64-mingw32/include/c++/15.1.0/bits/locale_conv.h:262:33: note: declared here
  262 |     class _GLIBCXX17_DEPRECATED wstring_convert
      |                                 ^~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions