Skip to content

Commit 314e9ea

Browse files
committed
Suppress false -Warray-bounds positive with -fsanitize=undefined
1 parent 771750f commit 314e9ea

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

test/array6.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,18 @@
77

88
#define BOOST_ALLOW_DEPRECATED_SYMBOLS // get_c_array
99

10+
#include <boost/array.hpp>
11+
#include <boost/core/lightweight_test.hpp>
12+
#include <boost/config.hpp>
1013
#include <string>
1114
#include <iostream>
12-
#include <boost/array.hpp>
1315
#include <algorithm>
1416

15-
#include <boost/core/lightweight_test_trait.hpp>
17+
#if defined(BOOST_GCC) && BOOST_GCC / 10000 == 12
18+
// false -Warray-bounds positive when using -fsanitize=undefined
19+
// restricted to GCC 12 because that's what is tested on Drone
20+
# pragma GCC diagnostic ignored "-Warray-bounds"
21+
#endif
1622

1723
namespace {
1824
template< class T >

0 commit comments

Comments
 (0)