On 3 May 2017 at 17:26, Liu Hao wrote: > On 2017/5/4 0:04, Papa wrote: >> >> Yes, absolutely right. That's what I thought as well. >> Now, who should look at this problem, MinGW64 or Gnu, who should I >> contact to report this bug? > > Please make sure it is really a bug before submitting it, by printing the > first byte of the string in question in your second example, in order to > make sure it is really a null-terminator (`--enable-fully-dynamic-string` > may cause trouble here, see PR16612): > > ```c++ > void jme::Locale::setGlobalLocale(const std::string& str){ > std::string tmp; > __builtin_printf("str[0] = %d\n", str.data()[0]); > tmp = std::setlocale(LC_ALL, str.data() ); > } > ``` > > I ask this mostly because the function `setlocale()` is provided by MSVCRT > and is totally opaque to MinGW-w64. And I can't reproduce the problem: Good to know. That's why I qualified my guess with ***Assuming the content of str is "",***. Because otherwise it's just another case of passing an unsupported argument to setlocale.