diff --git a/ulog_cpp/messages.hpp b/ulog_cpp/messages.hpp index 63f1a12..ce4b068 100644 --- a/ulog_cpp/messages.hpp +++ b/ulog_cpp/messages.hpp @@ -434,14 +434,14 @@ class Value { throw AccessException("Unexpected data type size"); } // GCC 14.2 raises an error here when building with -fsanitize=address -#ifdef __GNUC__ +#if defined(__GNUC__) && (__GNUC__ >= 14) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Warray-bounds" #pragma GCC diagnostic ignored "-Wstringop-overflow" #endif std::copy(backing_start + total_offset, backing_start + total_offset + sizeof(v), reinterpret_cast(&v)); -#ifdef __GNUC__ +#if defined(__GNUC__) && (__GNUC__ >= 14) #pragma GCC diagnostic pop #endif return v;