diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2018-07-17 11:55:14 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2018-07-17 11:55:14 +0200 |
commit | d3ca7e5e260dcf96fe3da8a04fadcd0e4e944971 (patch) | |
tree | 5f803f3b05ceb012314ab8a9dda0d6e413edcaaf /tests | |
parent | fa85bd1161d5d914095d1a3f9b620da294c9af79 (diff) | |
download | glibmm-d3ca7e5e260dcf96fe3da8a04fadcd0e4e944971.tar.gz |
Revert "Avoid compiler warnings from function pointer conversions"
This reverts commit fa85bd1161d5d914095d1a3f9b620da294c9af79.
This can be done in a better way by keeping the union in a template function.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/giomm_stream_vfuncs/main.cc | 2 | ||||
-rw-r--r-- | tests/glibmm_vector/main.cc | 13 |
2 files changed, 3 insertions, 12 deletions
diff --git a/tests/giomm_stream_vfuncs/main.cc b/tests/giomm_stream_vfuncs/main.cc index ad42e989..df1cde20 100644 --- a/tests/giomm_stream_vfuncs/main.cc +++ b/tests/giomm_stream_vfuncs/main.cc @@ -160,7 +160,7 @@ int main(int, char**) return EXIT_FAILURE; } } - catch (const Gio::Error& e) + catch (Gio::Error e) { std::cout << "Gio error: " << e.what() << std::endl; return EXIT_FAILURE; diff --git a/tests/glibmm_vector/main.cc b/tests/glibmm_vector/main.cc index 0f039356..31138cf0 100644 --- a/tests/glibmm_vector/main.cc +++ b/tests/glibmm_vector/main.cc @@ -196,23 +196,14 @@ public: ~Cache() { - // Conversion between different types of function pointers with - // reinterpret_cast can make gcc8 print a warning. - // https://github.com/libsigcplusplus/libsigcplusplus/issues/1 - union { - GFunc pf; - decltype(&g_object_unref) pou; - } u; - u.pou = &g_object_unref; - if (glist_) { - g_list_foreach(glist_, u.pf, nullptr); + g_list_foreach(glist_, reinterpret_cast<GFunc>(g_object_unref), nullptr); g_list_free(glist_); } if (gslist_) { - g_slist_foreach(gslist_, u.pf, nullptr); + g_slist_foreach(gslist_, reinterpret_cast<GFunc>(g_object_unref), nullptr); g_slist_free(gslist_); } if (garray_) |