fix(lib/gnss/test): mark buildRawFrame noinline to avoid GCC false positive (#26877)

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 <work@onurozkan.dev>
This commit is contained in:
Onur Özkan 2026-03-26 21:34:40 +03:00 committed by GitHub
parent f573dec0d9
commit 6b17795aa4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -69,7 +69,11 @@ protected:
}
// Helper to build a frame with raw payload bytes (no message type encoding)
std::vector<uint8_t> buildRawFrame(const std::vector<uint8_t> &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<uint8_t> buildRawFrame(const std::vector<uint8_t> &payload)
{
std::vector<uint8_t> frame;
size_t payload_len = payload.size();