Skip to content

Removed deprecation warnings - #139

Merged
ahcorde merged 2 commits into
rollingfrom
ahcorde/rolling/deprecation_warnings
Apr 20, 2026
Merged

ahcorde merged 2 commits into
rollingfrom
ahcorde/rolling/deprecation_warnings

Conversation

@ahcorde

@ahcorde ahcorde commented Apr 16, 2026

Copy link
Copy Markdown
Contributor

Description

There are some warning when compiling with clang

/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/subscription_options.hpp:200:35: warning: 'get_rcl_allocator<char, tlsf_heap_allocator<char>, nullptr>' is deprecated: Conversion of C++ allocators to C style is not valid, as the size on deallocatecan not be determined. This will be remove in future versions of ros. To suppress this warningdefine the method 'rcl_allocator_t get_rcl_allocator()' on your allocator [-Wdeprecated-declarations]
  200 |         return rclcpp::allocator::get_rcl_allocator<char>(*plain_allocator_storage_);
      |                                   ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/subscription_options.hpp:131:30: note: in instantiation of member function 'rclcpp::SubscriptionOptionsWithAllocator<tlsf_heap_allocator<void>>::get_rcl_allocator' requested here
  131 |     result.allocator = this->get_rcl_allocator();
      |                              ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/subscription.hpp:132:15: note: in instantiation of member function 'rclcpp::SubscriptionOptionsWithAllocator<tlsf_heap_allocator<void>>::to_rcl_subscription_options' requested here
  132 |       options.to_rcl_subscription_options(qos),
      |               ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/allocator.h:173:24: note: in instantiation of member function 'rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>::Subscription' requested here
  173 |     ::new ((void*)__p) _Up(std::forward<_Args>(__args)...);
      |                        ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>>::construct<rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::node_interfaces::NodeBaseInterface *&, const rosidl_message_type_support_t &, const std::string &, const rclcpp::QoS &, const rclcpp::AnySubscriptionCallback<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>> &, const rclcpp::SubscriptionOptionsWithAllocator<tlsf_heap_allocator<void>> &, const std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>> &, const std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics> &>' requested here
  296 |     __a.construct(__p, std::forward<_Args>(__args)...);
      |         ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>>>::construct<rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::node_interfaces::NodeBaseInterface *&, const rosidl_message_type_support_t &, const std::string &, const rclcpp::QoS &, const rclcpp::AnySubscriptionCallback<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>> &, const rclcpp::SubscriptionOptionsWithAllocator<tlsf_heap_allocator<void>> &, const std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>> &, const std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics> &, void>' requested here
  265 |     allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), std::forward<_Args>(__args)...);
      |                                 ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/shared_ptr.h:823:51: note: (skipping 3 contexts in backtrace; use -ftemplate-backtrace-limit=0 to see all)
  823 |   ::new ((void*)std::addressof(*__guard.__get())) _ControlBlock(__a, std::forward<_Args>(__args)...);
      |                                                   ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/subscription_factory.hpp:106:54: note: in instantiation of function template specialization 'rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>::make_shared<rclcpp::node_interfaces::NodeBaseInterface *&, const rosidl_message_type_support_t &, const std::string &, const rclcpp::QoS &, const rclcpp::AnySubscriptionCallback<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>> &, const rclcpp::SubscriptionOptionsWithAllocator<tlsf_heap_allocator<void>> &, const std::shared_ptr<rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>> &, const std::shared_ptr<rclcpp::topic_statistics::SubscriptionTopicStatistics> &>' requested here
  106 |       auto sub = Subscription<MessageT, AllocatorT>::make_shared(
      |                                                      ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/create_subscription.hpp:121:26: note: in instantiation of function template specialization 'rclcpp::create_subscription_factory<std_msgs::msg::UInt32_<std::allocator<void>>, (lambda at /home/ahcorde/ros2_rolling/src/ros2/realtime_support/tlsf_cpp/example/allocator_example.cpp:65:19) &, tlsf_heap_allocator<void>, rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>>' requested here
  121 |   auto factory = rclcpp::create_subscription_factory<MessageT>(
      |                          ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/create_subscription.hpp:189:26: note: in instantiation of function template specialization 'rclcpp::detail::create_subscription<std_msgs::msg::UInt32_<std::allocator<void>>, (lambda at /home/ahcorde/ros2_rolling/src/ros2/realtime_support/tlsf_cpp/example/allocator_example.cpp:65:19) &, tlsf_heap_allocator<void>, rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::Node, rclcpp::Node>' requested here
  189 |   return rclcpp::detail::create_subscription<
      |                          ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/node_impl.hpp:100:18: note: in instantiation of function template specialization 'rclcpp::create_subscription<std_msgs::msg::UInt32_<std::allocator<void>>, (lambda at /home/ahcorde/ros2_rolling/src/ros2/realtime_support/tlsf_cpp/example/allocator_example.cpp:65:19) &, tlsf_heap_allocator<void>, rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::Node>' requested here
  100 |   return rclcpp::create_subscription<MessageT>(
      |                  ^
/home/ahcorde/ros2_rolling/src/ros2/realtime_support/tlsf_cpp/example/allocator_example.cpp:83:27: note: in instantiation of function template specialization 'rclcpp::Node::create_subscription<std_msgs::msg::UInt32_<std::allocator<void>>, (lambda at /home/ahcorde/ros2_rolling/src/ros2/realtime_support/tlsf_cpp/example/allocator_example.cpp:65:19) &, tlsf_heap_allocator<void>, rclcpp::Subscription<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>, rclcpp::message_memory_strategy::MessageMemoryStrategy<std_msgs::msg::UInt32_<std::allocator<void>>, tlsf_heap_allocator<void>>>' requested here
   83 |   auto subscriber = node->create_subscription<std_msgs::msg::UInt32>(
      |                           ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/allocator/allocator_common.hpp:123:3: note: 'get_rcl_allocator<char, tlsf_heap_allocator<char>, nullptr>' has been explicitly marked deprecated here
  123 | [[deprecated("Conversion of C++ allocators to C style is not valid, as the size on deallocate"
      |   ^
In file included from /home/ahcorde/ros2_rolling/src/ros2/realtime_support/tlsf_cpp/example/allocator_example.cpp:21:
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/strategies/allocator_memory_strategy.hpp:521:33: warning: 'get_rcl_allocator<void *, tlsf_heap_allocator<void *>, nullptr>' is deprecated: Conversion of C++ allocators to C style is not valid, as the size on deallocatecan not be determined. This will be remove in future versions of ros. To suppress this warningdefine the method 'rcl_allocator_t get_rcl_allocator()' on your allocator [-Wdeprecated-declarations]
  521 |       return rclcpp::allocator::get_rcl_allocator<void *, VoidAlloc>(*allocator_.get());
      |                                 ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/strategies/allocator_memory_strategy.hpp:55:12: note: in instantiation of member function 'rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>::get_allocator' requested here
   55 |   explicit AllocatorMemoryStrategy(std::shared_ptr<Alloc> allocator)
      |            ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/allocator.h:173:24: note: in instantiation of member function 'rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>::AllocatorMemoryStrategy' requested here
  173 |     ::new ((void*)__p) _Up(std::forward<_Args>(__args)...);
      |                        ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/allocator_traits.h:296:9: note: in instantiation of function template specialization 'std::allocator<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>>::construct<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>, std::shared_ptr<tlsf_heap_allocator<void>> &>' requested here
  296 |     __a.construct(__p, std::forward<_Args>(__args)...);
      |         ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/shared_ptr.h:265:33: note: in instantiation of function template specialization 'std::allocator_traits<std::allocator<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>>>::construct<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>, std::shared_ptr<tlsf_heap_allocator<void>> &, void>' requested here
  265 |     allocator_traits<_TpAlloc>::construct(__tmp, __get_elem(), std::forward<_Args>(__args)...);
      |                                 ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/shared_ptr.h:823:51: note: in instantiation of function template specialization 'std::__shared_ptr_emplace<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>, std::allocator<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>>>::__shared_ptr_emplace<std::shared_ptr<tlsf_heap_allocator<void>> &, std::allocator<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>>, 0>' requested here
  823 |   ::new ((void*)std::addressof(*__guard.__get())) _ControlBlock(__a, std::forward<_Args>(__args)...);
      |                                                   ^
/usr/lib/llvm-18/bin/../include/c++/v1/__memory/shared_ptr.h:831:15: note: in instantiation of function template specialization 'std::allocate_shared<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>, std::allocator<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>>, std::shared_ptr<tlsf_heap_allocator<void>> &, void>' requested here
  831 |   return std::allocate_shared<_Tp>(allocator<_Tp>(), std::forward<_Args>(__args)...);
      |               ^
/home/ahcorde/ros2_rolling/src/ros2/realtime_support/tlsf_cpp/example/allocator_example.cpp:89:10: note: in instantiation of function template specialization 'std::make_shared<rclcpp::memory_strategies::allocator_memory_strategy::AllocatorMemoryStrategy<tlsf_heap_allocator<void>>, std::shared_ptr<tlsf_heap_allocator<void>> &, void>' requested here
   89 |     std::make_shared<AllocatorMemoryStrategy<Alloc>>(alloc);
      |          ^
/home/ahcorde/ros2_rolling/install/include/rclcpp/rclcpp/allocator/allocator_common.hpp:123:3: note: 'get_rcl_allocator<void *, tlsf_heap_allocator<void *>, nullptr>' has been explicitly marked deprecated here
  123 | [[deprecated("Conversion of C++ allocators to C style is not valid, as the size on deallocate"
      |   ^
4 warnings generated.

Did you use Generative AI?

Claude Sonnet 4.6

Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
@ahcorde ahcorde self-assigned this Apr 16, 2026
@ahcorde
ahcorde requested a review from asymingt April 16, 2026 21:17
Comment thread tlsf_cpp/CMakeLists.txt
endif()

# Default to C++17
# Default to C++20

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

Signed-off-by: Alejandro Hernandez Cordero <[email protected]>
@ahcorde

ahcorde commented Apr 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Pulls: #139
Gist: https://gist.githubusercontent.com/ahcorde/750ccc38ad61d6bbaf766cac9a660b5d/raw/6089873b7ff27e16336399c495265c9a0ea5fe28/ros2.repos
BUILD args: --packages-above-and-dependencies tlsf_cpp
TEST args: --packages-above tlsf_cpp
ROS Distro: rolling
Job: ci_launcher
ci_launcher ran: https://ci.ros2.org/job/ci_launcher/18984

  • Linux Build Status
  • Linux-aarch64 Build Status
  • Linux-rhel Build Status
  • Windows Build Status

@ahcorde
ahcorde merged commit d7f9bb8 into rolling Apr 20, 2026
3 checks passed
@ahcorde
ahcorde deleted the ahcorde/rolling/deprecation_warnings branch April 20, 2026 13:55
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