From 6b17795aa482b37cb80e5b6a4d8b72fd22cfc4d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Onur=20=C3=96zkan?= Date: Thu, 26 Mar 2026 21:34:40 +0300 Subject: [PATCH] fix(lib/gnss/test): mark buildRawFrame noinline to avoid GCC false positive (#26877) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GCC 14.3.0 emits `-Wstringop-overflow` when `RtcmTest::buildRawFrame()` is optimized and inlined. This change marks the helper `noinline` to keep it out of that optimization path. Preserves the existing logic and only changes how the compiler emits the test helper. Fixes https://github.com/PX4/PX4-Autopilot/issues/26875 Signed-off-by: Onur Özkan --- src/lib/gnss/test/RtcmTestCommon.hpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/lib/gnss/test/RtcmTestCommon.hpp b/src/lib/gnss/test/RtcmTestCommon.hpp index f2012d353e..aea6275b56 100644 --- a/src/lib/gnss/test/RtcmTestCommon.hpp +++ b/src/lib/gnss/test/RtcmTestCommon.hpp @@ -69,7 +69,11 @@ protected: } // Helper to build a frame with raw payload bytes (no message type encoding) - std::vector buildRawFrame(const std::vector &payload) + // + // Keep this helper out-of-line to avoid a GCC false positive on the + // inlined std::vector::push_back. + // See https://github.com/PX4/PX4-Autopilot/issues/26875 for details. + __attribute__((noinline)) std::vector buildRawFrame(const std::vector &payload) { std::vector frame; size_t payload_len = payload.size();