zeromq / azmq

C++ language binding library integrating ZeroMQ with Boost Asio

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the code use deprecated interfaces of boost::asio

ClausKlein opened this issue · comments

with modern boost version, it does not compile:

bash-3.2$ builddriver make
builddriver executing: 'make'
Compilation FAILED in 2.877182 seconds
Number of warnings: 0
Number of errors: 111
Last Error:
  Message: "no viable conversion from returned value of type 'void' to function return type 'boost::system::error_code'"
  Path: /Users/clausklein/Workspace/c/libzmq/examples/azmq/azmq/detail/socket_ops.hpp
  Line Number: 119
  Column: 20
For full log, please open: /var/folders/wb/ckvxxgls5db7qyhqq4y5_l1c0000gq/T/build-d29l5xbh.log
bash-3.2$

build-d29l5xbh.log

It compiles with the latest boost version 1.76, but when you flick on BOOST_ASIO_NO_DEPRECATED, I think it removes the deprecated interfaces, so it not surprising it bombs. I assume we could fix this but then we'll probably have to raise the minimum boost version - I'm not sure if this would affect azmq users? Perhaps its reasonably to only support boost and zmq version from the last two years. Thoughts?

Starting with v1.71, boost is installed with cmake config packages, which can used as noted in my TODO: lines.
debian stable still delivers an older boost version, but it supports this option too!

The BOOST_ASIO_NO_DEPRECATED is available since c++17 is finished.

IMHO, it should not activated at the moment, because of the this azmq interface:

         template<typename T>
         T const& buffer_cast() const {
              return *boost::asio::buffer_cast<T const*>(buffer()); // FIXME: deprecated! CK
         }

The lastes ZMQ4 git version export a cmake config packages too, but this is no available on GitHub CI?

I would prefer to use it like this:

find_package(ZeroMQ 4.3 CONFIG REQUIRED) 
target_link_libraries(azmq INTERFACE ZeroMQ::libzmq Boost::thread)

but the namespace is missing in ZMQ4?

I have modernise so far the code to use the std asio interfaces were possible.
This compiles without any warning, clang-tidy is happy, but the are test errors?

It needs more love ...

see too ClausKlein#1

IMHO, it should not activated at the moment, because of the this azmq interface:

I would recommend that either that azmq interface be deprecated as well, or find a way to implement it without using the deprecated asio function.

Removing BOOST_ASIO_NO_DEPRECATED from my build configs to satisfy azmq does not seem like a good solution.