Skip to content

Commit 27e48b7

Browse files
author
chenmou
committed
Fix MSVC warning C4068
1 parent 8eb082e commit 27e48b7

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

immer/detail/hamts/node.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,13 @@
1818

1919
// Disable some warnings for this file as it seems to be causing various
2020
// false positives when compiling with various versions of GCC.
21+
#if !defined(_MSC_VER)
22+
#if defined(__GNUC__) && !defined(__clang__)
2123
#pragma GCC diagnostic push
2224
#pragma GCC diagnostic ignored "-Warray-bounds"
2325
#pragma GCC diagnostic ignored "-Wstringop-overflow"
26+
#endif
27+
#endif
2428

2529
namespace immer {
2630
namespace detail {
@@ -1159,4 +1163,8 @@ struct node
11591163
} // namespace detail
11601164
} // namespace immer
11611165

1166+
#if !defined(_MSC_VER)
1167+
#if defined(__GNUC__) && !defined(__clang__)
11621168
#pragma GCC diagnostic pop
1169+
#endif
1170+
#endif

immer/detail/rbts/node.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,14 @@
2121

2222
// Disable some warnings for this file as it seems to be causing various
2323
// false positives when compiling with various versions of GCC.
24+
#if !defined(_MSC_VER)
25+
#if defined(__GNUC__) && !defined(__clang__)
2426
#pragma GCC diagnostic push
2527
#pragma GCC diagnostic ignored "-Warray-bounds"
2628
#pragma GCC diagnostic ignored "-Wstringop-overflow"
2729
#pragma GCC diagnostic ignored "-Wnonnull"
30+
#endif
31+
#endif
2832

2933
namespace immer {
3034
namespace detail {
@@ -1039,4 +1043,8 @@ constexpr bits_t derive_bits_leaf = derive_bits_leaf_aux<T, MP, B>();
10391043
} // namespace detail
10401044
} // namespace immer
10411045

1046+
#if !defined(_MSC_VER)
1047+
#if defined(__GNUC__) && !defined(__clang__)
10421048
#pragma GCC diagnostic pop
1049+
#endif
1050+
#endif

0 commit comments

Comments
 (0)