diff --git a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp index f2fa3c0b5..2adc767d1 100644 --- a/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp +++ b/rosidl_runtime_cpp/include/rosidl_runtime_cpp/bounded_vector.hpp @@ -21,6 +21,16 @@ #include #include +// GCC 13 has false positive warnings around stringop-overflow and array-bounds. +// The layout of a BoundedVector triggers these warnings. Suppress them +// until this is fixed in upstream gcc. See +// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114758 for more details. +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wstringop-overflow" +#pragma GCC diagnostic ignored "-Warray-bounds" +#endif + namespace rosidl_runtime_cpp { @@ -789,4 +799,8 @@ swap(BoundedVector & x, BoundedVector