Skip to content

Commit 4d18676

Browse files
committed
Add UNREACHABLE_CODE suppress, apply to bogus LTCG warning.
1 parent c83554e commit 4d18676

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

include/bitcoin/system/allocator.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,12 @@ class allocator
118118
auto ptr = allocate_object<Type>();
119119
construct_guard<Type> guard{ arena_, ptr };
120120
construct<Type>(ptr, std::forward<Args>(args)...);
121+
122+
// Bogus warning (under LTCG only).
123+
BC_PUSH_WARNING(UNREACHABLE_CODE)
121124
guard.arena_ = nullptr;
125+
BC_POP_WARNING()
126+
122127
return ptr;
123128
}
124129

include/bitcoin/system/warnings.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
#define THROW_FROM_NOEXCEPT 4297
4545
#define TRUNCATED_CONSTANT 4310
4646
#define LOCAL_VARIABLE_NOT_INITIALIZED 4700
47+
#define UNREACHABLE_CODE 4702
4748
#define NOT_INLINED 4714
4849
#define DISCARDING_NON_DISCARDABLE 4834
4950

0 commit comments

Comments
 (0)