I am trying to use cppunit to test the wxWidgets building under Windows 10 32 bit MSys2 (MSys2 is a fork of CygWin).Code:#include <iostream> #include <wchar.h> int main() { bool failed = false; int i = 0; wchar_t wstr[20]; std::wstring wide_input(L"42 test"); std::wstring wide_result(L"test"); std::cout << "Testing swscanf function!" << std::endl; swscanf(wide_input.c_str(), L"%d %s", &i, &wstr); if (i != 42){ failed = true; } if (wstr != wide_result){ failed = true; } if (failed == true){ return -1; } std::cerr << "Passed all of the tests"; return 0; }
And, the cppunit tests segfaults; where it segfaults suggest a broken swscanf support function called __mingw_swformat in the crt library.
The MSys2 GCC crt library is based on MinGW-64 crt library with only slight patches.
Edit: The above code crashes when compiled with the MSys2 GCC (Rev1, Built by MSYS2 project) 6.3.0.
Tim S.