From 212befddf6c62cd3bcce0a0edd44e072cd3ddf0c Mon Sep 17 00:00:00 2001 From: "Daniel X. Pape" Date: Thu, 16 Jan 2020 16:52:22 -0800 Subject: [PATCH] small changes needed for gcc 7, 8 and 9 --- examples/cpp_example.cpp | 2 +- test/testbech32/CMakeLists.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/cpp_example.cpp b/examples/cpp_example.cpp index f491bb4..a5c62eb 100644 --- a/examples/cpp_example.cpp +++ b/examples/cpp_example.cpp @@ -66,7 +66,7 @@ void badEncoding() { std::string bstr = bech32::encode(hrp, data); } catch (std::exception &e) { - assert(strcmp(e.what(), "data value is out of range") == 0); + assert(std::string(e.what()) == "data value is out of range"); } } diff --git a/test/testbech32/CMakeLists.txt b/test/testbech32/CMakeLists.txt index 5771191..95380ea 100644 --- a/test/testbech32/CMakeLists.txt +++ b/test/testbech32/CMakeLists.txt @@ -20,6 +20,7 @@ add_executable(bech32_c_api_tests ) target_compile_features(bech32_c_api_tests PRIVATE c_std_99) +target_compile_options(bech32_c_api_tests PRIVATE "-fPIC") set_target_properties(bech32_c_api_tests PROPERTIES C_EXTENSIONS OFF) target_link_libraries(bech32_c_api_tests PUBLIC bech32)