Add deprecation control macros and update MemoryStrategy class#3144
Add deprecation control macros and update MemoryStrategy class#3144EricX-Zhao wants to merge 1 commit into
Conversation
…ation Signed-off-by: EricX-Zhao <ericzhao0325@163.com>
|
GCC11 is not a target compiler for rolling. Could you give more information on why you need support for this ancient platform ? |
|
In some embedded devices, the operating system is Ubuntu 22.04 or earlier, and the gcc version is relatively old. Updating to rolling or lyrical versions still requires cross-compilation. This PR has been verified with minimal code to compile successfully on gcc11, gcc15, and MSVC, and deprecated warnings work correctly. |
|
rolling dropped support for 22.04 with the release of lyrical. |
|
This PR deprecation_control is like visibility_control that provides cross-platform macros for marking class declarations as deprecated |
|
Using these macros is a step backwards, we go from a standardized construct back to a compiler specific solution. Therefore I am rejecting this PR. The deprecation has been merged in Lyrical, therefore you could change the PR to just remove all of the MemoryStrategy for rolling. Note, that you will need to also open PRs for the fallout in the other core packages. |
|
Thanks for the clarification and I'll close this PR. |
Description
Introduces a new deprecation_control.hpp header that provides cross-platform macros (RCLCPP_DEPRECATED and RCLCPP_DEPRECATED_WITH_MSG) for marking class declarations as deprecated, and updates MemoryStrategy to use them.
Background: The standard C++14 [[deprecated]] attribute works portably on functions, variables, and type aliases, but its placement on a class declaration that also carries a visibility macro (e.g., RCLCPP_PUBLIC) is inconsistent across GCC, Clang, and MSVC — no single placement satisfies all three compilers. This was exposed by #3136, which added [[deprecated(...)]] directly to MemoryStrategy.
Minimize code verification
Is this user-facing behavior change?
No behavioral change. Compiler deprecation warnings for MemoryStrategy now work correctly on MSVC in addition to GCC and Clang.
Did you use Generative AI?
With Claude Sonnet 4.6 via Claude Code.
Additional Information
#3142