mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
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:
@@ -69,7 +69,11 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Helper to build a frame with raw payload bytes (no message type encoding)
|
// 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;
|
std::vector<uint8_t> frame;
|
||||||
size_t payload_len = payload.size();
|
size_t payload_len = payload.size();
|
||||||
|
|||||||
Reference in New Issue
Block a user