Skip to content

Commit

Permalink
Suppress warnings in the benchmarks for upstream GCC false positives. (
Browse files Browse the repository at this point in the history
…#810)

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette authored Jun 12, 2024
1 parent 4ba0eff commit 57940a2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions rosidl_runtime_cpp/test/benchmark/benchmark_bounded_vector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,18 @@ BENCHMARK_F(PerformanceTest, bounded_vector_insert)(benchmark::State & st)
for (auto _ : st) {
(void)_;
v.insert(v.begin(), v2.begin(), v2.end());
// GCC 13 has false positive warnings around stringop-overflow and array-bounds.
// 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
v.erase(v.begin());
#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif
}
}

Expand Down

0 comments on commit 57940a2

Please sign in to comment.