From 4ee456bd901c13a0143151da042a359ffef73f5e Mon Sep 17 00:00:00 2001 From: Ahmet Burak Tektas <15087318+Abtektas@users.noreply.github.com> Date: Sat, 17 Oct 2026 01:38:37 +0200 Subject: [PATCH] fix(mc_raptor): build with clang (#29276) Apple clang stops px4_sitl_raptor in mc_raptor on two warnings: -Wcast-align for the pointer rl_tools stores in front of its aligned allocations, and -Wunused-private-field for timestamp_last_manual_control_input, which is never used. Build the module with -Wno-cast-align, as mc_nn_control does, and remove the unused timestamp and its _set flag. Assisted-by: Claude:claude-opus-5-5 Signed-off-by: A.Burak Tektas <15087318+Abtektas@users.noreply.github.com> --- src/modules/mc_raptor/CMakeLists.txt | 2 ++ src/modules/mc_raptor/mc_raptor.hpp | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/mc_raptor/CMakeLists.txt b/src/modules/mc_raptor/CMakeLists.txt index 5cde7918274..c5a741806b7 100644 --- a/src/modules/mc_raptor/CMakeLists.txt +++ b/src/modules/mc_raptor/CMakeLists.txt @@ -19,3 +19,5 @@ px4_add_module( target_compile_features(modules__mc_raptor PRIVATE cxx_std_17) target_compile_options(modules__mc_raptor PRIVATE -Wno-unused-result) +# clang reports the pointer stored in front of rl_tools' aligned allocations with -Wcast-align +target_compile_options(modules__mc_raptor PRIVATE -Wno-cast-align) diff --git a/src/modules/mc_raptor/mc_raptor.hpp b/src/modules/mc_raptor/mc_raptor.hpp index fcd320350d5..95f024ad7a8 100644 --- a/src/modules/mc_raptor/mc_raptor.hpp +++ b/src/modules/mc_raptor/mc_raptor.hpp @@ -135,9 +135,9 @@ private: vehicle_status_s _vehicle_status{}; trajectory_setpoint_s _trajectory_setpoint{}; hrt_abstime timestamp_last_local_position, timestamp_last_angular_velocity, timestamp_last_attitude, timestamp_last_trajectory_setpoint, - timestamp_last_manual_control_input, timestamp_last_vehicle_status; + timestamp_last_vehicle_status; bool timestamp_last_local_position_set = false, timestamp_last_angular_velocity_set = false, timestamp_last_attitude_set = false, - timestamp_last_trajectory_setpoint_set = false, timestamp_last_manual_control_input_set = false, timestamp_last_vehicle_status_set = false; + timestamp_last_trajectory_setpoint_set = false, timestamp_last_vehicle_status_set = false; bool timeout_message_sent = false; bool previous_trajectory_setpoint_stale = false; bool previous_active = false;