Skip to content

Commit 43c4c6a

Browse files
committed
Silence -Wover-aligned warnings
1 parent 20f6543 commit 43c4c6a

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/builder/core.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include <bsoncxx/v1/detail/macros.hpp>
16+
1517
#include <cstring>
1618

1719
#include <bsoncxx/builder/core.hpp>
@@ -251,7 +253,11 @@ class core::impl {
251253
};
252254

253255
core::core(bool is_array) {
256+
BSONCXX_PRIVATE_WARNINGS_PUSH();
257+
BSONCXX_PRIVATE_WARNINGS_DISABLE(Clang("-Wover-aligned"));
258+
BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4316));
254259
_impl = make_unique<impl>(is_array);
260+
BSONCXX_PRIVATE_WARNINGS_POP();
255261
}
256262

257263
core::core(core&&) noexcept = default;

src/bsoncxx/lib/bsoncxx/v_noabi/bsoncxx/private/make_unique.hh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@
3737
namespace bsoncxx {
3838
namespace detail {
3939

40+
BSONCXX_PRIVATE_WARNINGS_PUSH();
41+
BSONCXX_PRIVATE_WARNINGS_DISABLE(Clang("-Wover-aligned"));
42+
BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4316));
43+
4044
// Switch backend of make_unique by the type we are creating.
4145
// It would be easier to 'if constexpr' on whether we are an array and whether to direct-init or
4246
// value-init, but we don't have if-constexpr and we need it to guard against an uterance of a
@@ -94,6 +98,8 @@ struct make_unique_impl<T&> {};
9498
template <typename T>
9599
struct make_unique_impl<T&&> {};
96100

101+
BSONCXX_PRIVATE_WARNINGS_POP();
102+
97103
} // namespace detail
98104
} // namespace bsoncxx
99105

src/mongocxx/lib/mongocxx/v_noabi/mongocxx/client_session.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15+
#include <bsoncxx/v1/detail/macros.hpp>
16+
1517
#include <bsoncxx/private/make_unique.hh>
1618

1719
#include <mongocxx/exception/exception.hpp>
@@ -25,10 +27,14 @@ namespace mongocxx {
2527
namespace v_noabi {
2628

2729
// Private constructors.
30+
BSONCXX_PRIVATE_WARNINGS_PUSH();
31+
BSONCXX_PRIVATE_WARNINGS_DISABLE(Clang("-Wover-aligned"));
32+
BSONCXX_PRIVATE_WARNINGS_DISABLE(MSVC(4316));
2833
client_session::client_session(
2934
mongocxx::v_noabi::client const* client,
3035
mongocxx::v_noabi::options::client_session const& options)
3136
: _impl(bsoncxx::make_unique<impl>(client, options)) {}
37+
BSONCXX_PRIVATE_WARNINGS_POP();
3238

3339
client_session::client_session(client_session&&) noexcept = default;
3440

0 commit comments

Comments
 (0)