testlib
testlib copied to clipboard
mingw-w64 sscanf bug
There is a bug in mingw-w64 implementation of sscanf when reading doubles (see mingw-w64/bugs/989).
sscanf is used to read doubles here: testlib/0.9.41/testlib.h:3562. And testlib is run on Codeforces under mingw-w64.
I'm guessing it's gonna take a while for it to get fixed and pushed through deployment pipelines.
Meanwhile you can detect compilation target with something like #ifdef __MINGW64_VERSION_MAJOR (see Detect mingw thread) and switch to some alternative that doesn't have bugs under minw-w64, such as std::from_chars
After it gets fixed, you can switch back to sscanf on #if __MINGW64_VERSION_[MAJOR|MINOR|BUGFIX] >= fixed_version