mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +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:
parent
f573dec0d9
commit
6b17795aa4
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user