Skip to content

Commit 483d501

Browse files
committed
Ignore 'warning C4702: unreachable code' in MSVC 2015
1 parent 99ca9aa commit 483d501

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

tests/test_iostream.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
BSD-style license that can be found in the LICENSE file.
88
*/
99

10+
#if defined(_MSC_VER) && _MSC_VER < 1910 // VS 2015's MSVC
11+
# pragma warning(disable: 4702) // unreachable code in system header (xatomic.h(382))
12+
#endif
1013

1114
#include <pybind11/iostream.h>
1215
#include "pybind11_tests.h"
@@ -44,7 +47,7 @@ struct TestThread {
4447
delete t_;
4548
}
4649

47-
void stop() { stop_ = 1; }
50+
void stop() { stop_ = true; }
4851

4952
void join() {
5053
py::gil_scoped_release gil_lock;

tests/test_smart_ptr.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
BSD-style license that can be found in the LICENSE file.
99
*/
1010

11-
#if defined(_MSC_VER) && _MSC_VER < 1910
12-
# pragma warning(disable: 4702) // unreachable code in system header
11+
#if defined(_MSC_VER) && _MSC_VER < 1910 // VS 2015's MSVC
12+
# pragma warning(disable: 4702) // unreachable code in system header (xatomic.h(382))
1313
#endif
1414

1515
#include "pybind11_tests.h"

0 commit comments

Comments
 (0)