Backport #2353 to humble (-Wpessimizing-move in intra_process_manager.hpp)
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
检查 experimental/intra_process_manager.hpp 中第 465 行和第 507 行所标识的两个 std::move 调用,并将其与 rolling 上 #2353 中对应的更改进行比较。使用提供的 ROS Humble/GCC 命令重现该警告,然后验证该头文件在 -Wall 下构建时不会出现这两个 -Wpessimizing-move 警告。
由索引模型根据 Issue 内容生成。
描述
humble still has the two std::move(MessageUniquePtr(ptr, deleter)) calls in experimental/intra_process_manager.hpp (lines 465 and 507 in 16.0.19) that #2353 removed on rolling. Any package that calls Publisher::publish() and builds with -Wall on GCC 13 or newer gets two warnings from the header.
Repro with the ros:humble headers and GCC 15.3:
docker build -t rclcpp-humble-gcc15 - <<'EOF'
FROM ros:humble AS ros
FROM gcc:15
COPY --from=ros /opt/ros/humble /opt/ros/humble
EOF
docker run --rm rclcpp-humble-gcc15 bash -c '
printf "%s\n" "#include <rclcpp/rclcpp.hpp>" "#include <std_msgs/msg/int32.hpp>" \
"void f(rclcpp::Publisher<std_msgs::msg::Int32> & p) { p.publish(std_msgs::msg::Int32{}); }" > t.cpp
g++ -std=c++17 -fsyntax-only -Wall t.cpp \
$(find /opt/ros/humble/include -mindepth 1 -maxdepth 1 -type d -printf "-I%p ") 2>&1 | grep pessimizing'
intra_process_manager.hpp:465:51: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
intra_process_manager.hpp:507:68: warning: moving a temporary object prevents copy elision [-Wpessimizing-move]
Dropping the two std::move calls the same way #2353 does silences both. Could it be backported to humble?
- 主要语言
- C++
- 星标
- 814
- 派生
- 572
- 平均合并
- 5 天 3 小时
- 30 天内合并 PR
- 17
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ros2/rclcpp 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 70/100
维护者通常 1 天内回复
-
Copy constructor exception leaks intra-process message allocation可能已有人在做 @TinyGeek 于 2 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 35/100
维护者通常 1 天内回复
-
[Jazzy] action server registers clock jump callbacks without the clock mutex (heap corruption)可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭bug
难度 4/5 3-5 天 新手友好度 44/100
维护者通常 1 天内回复
-
EventsCBGExecutor segfaults when a timer is removed while its callback is running可能已有人在做 @spurnvoj 于 7 天前认领。 未关闭bug
难度 4/5 3-5 天 新手友好度 35/100
维护者通常 1 天内回复
-
EventsCBGExecutor keeps queued events of removed nodes, component container segfaults on shutdown可能已有人在做 @spurnvoj 于 7 天前认领。 未关闭
难度 5/5 一周以上 新手友好度 18/100
维护者通常 1 天内回复
相似的 Issue
-
refactor
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
compiler-explorer/compiler-explorer#9272 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 65/100
-
难度 1/5 1 小时以内 新手友好度 76/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
维护者通常 1 天内回复