Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the code use deprecated interfaces of boost::asio #184

Open
ClausKlein opened this issue Sep 11, 2021 · 5 comments
Open

the code use deprecated interfaces of boost::asio #184

ClausKlein opened this issue Sep 11, 2021 · 5 comments

Comments

@ClausKlein
Copy link

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

@ClausKlein
Copy link
Author

@aboseley
Copy link

aboseley commented Sep 13, 2021

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?

@ClausKlein
Copy link
Author

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?

@ClausKlein
Copy link
Author

ClausKlein commented Sep 13, 2021

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

@sweemer
Copy link

sweemer commented Apr 15, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants