Suppressed gcc 7.1 maybe-uninitialized warning.

When I execute cmake `-DMSGPACK_CXX11=OFF`, gcc 7.1 reports the warning.
I've already added the warning suppression pragma, but it doesn't work
in this case. So I added explicit initializing code even if it is redundant.
This commit is contained in:
Takatoshi Kondo
2017-06-12 14:11:21 +09:00
parent 7214b4c73f
commit 684c5e0bb0

View File

@@ -152,7 +152,7 @@ public:
#pragma GCC diagnostic push #pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" #pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__) #endif // (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7)) && !defined(__clang__)
msgpack::type::tuple<bool, msgpack::object> tuple; msgpack::type::tuple<bool, msgpack::object> tuple(false, msgpack::object());
o.convert(tuple); o.convert(tuple);
is_double = tuple.get<0>(); is_double = tuple.get<0>();