Takatoshi Kondo
Takatoshi Kondo
> Unfortunately my application is using msgpack-rpc and it doesn't seem to support the C++11 headers yet, so I have to build with -std=c++03. Does that prevent a msgpack-rpc user...
```cpp msgpack::object msg_obj = msgpack::unpack(sbuf.str().c_str(), sbuf.str().length()).get(); ``` Seems to be wrong. `msgpack::unpack(sbuf.str().c_str(), sbuf.str().length())` returns `msgpack::object` and you need to keep the lifetime of it. ```cpp msgpack::object msg_obj = msgpack::unpack(sbuf.str().c_str(), sbuf.str().length()).get();...
Important point is keeping lifetime of `msgpack::object_handle`. Consider this example that has the same concept. ```cpp char const* ptr = std::string("ABC").c_str(); ``` http://www.cplusplus.com/reference/string/string/c_str/ The temporary object `std::string("ABC")` is over in...
I copied and pasted your code then added required include files, replaced test with main, and print msgpack-c version. Here is the code: https://wandbox.org/permlink/O4K7A0HnafE0Rkqr `BAD CAST` isn't output.
For C++, you can limit the size as follows: https://github.com/msgpack/msgpack-c/wiki/v2_0_cpp_unpacker#limit-size-of-elements
I'm not sure about C version. But if limit size is good enough, MSGPACK_XXX_LIMIT macro is acceptable. But as you mentioned it's a bit crude. C++ is using limit and...
> https://github.com/msgpack/msgpack-c/blob/63511f29dbac8a1200a7653e561055e82e43d391/include/msgpack/v2/create_object_visitor.hpp#L199 > > The c++ version allocates the whole array at once, as well. The code to pointed at is the parse buffer (which is indeed managed with exponential...
I checked CMakeLists.txt but I couldn't find the problem. All CMAKE_CXX_FLAGS preserved at all places. > ```cmake > TARGET_COMPILE_DEFINITIONS(msgpackc-cxx INTERFACE MSGPACK_NO_BOOST) # possibly add other flags as well > ```...
``` cmake -DCMAKE_CXX_FLAGS="-DMSGPACK_NO_BOOST" ``` could be workaround. Essential fix is not yet.
According to the cmake document https://cmake.org/cmake/help/latest/command/add_library.html add_library is defined as follows in up to date spec: ```cmake add_library( INTERFACE [...] [EXCLUDE_FROM_ALL]) ``` I read the doucment but I didn't understand...