#include #include #include extern "C" int string_length() { std::string text(4096, 'x'); text += std::to_string(123); return static_cast(text.size()); } extern "C" void string_throw() { try { throw std::invalid_argument("string failure"); } catch (const std::exception &e) { std::fprintf(stderr, "%s\n", e.what()); if (std::string(e.what()) == "string failure") throw; } }