Skip to content

Replace deprecated from_string with make_address_v4#68

Open
BasketsAlaaf wants to merge 1 commit intoSICKAG:masterfrom
BasketsAlaaf:fix-deprecated-boost-function-calls
Open

Replace deprecated from_string with make_address_v4#68
BasketsAlaaf wants to merge 1 commit intoSICKAG:masterfrom
BasketsAlaaf:fix-deprecated-boost-function-calls

Conversation

@BasketsAlaaf
Copy link

Description

Replace deprecated boost::asio::ip::address_v4::from_string() calls with the modern
boost::asio::ip::make_address_v4() free function for IPv4 address parsing.

Why this change is needed:

  • from_string() was deprecated in Boost 1.66
  • Eliminates deprecation warnings during compilation
  • Ensures compatibility with newer Boost versions (i.e. 1.87+)

Changes:

  • Updated 3 occurrences in SickSafetyscanners.hpp (sensor_ip, interface_ip, host_ip parsing)
  • Updated 1 occurrence in SickSafetyscanners.cpp (dynamic host_ip parameter callback)

Test Case

Steps to verify the changes:

  1. Build the package with a recent Boost version (≥1.66)
  2. Verify no deprecation warnings related to from_string() appear
  3. Launch the node with valid IP parameters
  4. Dynamically update the host_ip parameter at runtime

Expected result: Node builds without deprecation warnings and correctly parses all IP addresses

Replace `boost::asio::ip::address_v4::from_string()` with
`boost::asio::ip::make_address_v4()` for IPv4 address parsing.

The `from_string()` method was deprecated in Boost 1.66 in favor of
the free function `make_address_v4()`. This change ensures
compatibility with newer Boost versions and avoids deprecation
warnings during compilation.

Signed-off-by: Matthias Schoepfer <matthias.schoepfer@googlemail.com>
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

Successfully merging this pull request may close these issues.

2 participants