Skip to content

Commit 48d9a92

Browse files
author
Matthias Loy
committed
do intermediate step in order to omit "dereferencing type-punned pointer" error
1 parent f97723d commit 48d9a92

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib_json/json_value.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ namespace Json {
3434
#define ALIGNAS(byte_alignment)
3535
#endif
3636
static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = {0};
37-
const Value& Value::null = reinterpret_cast<const Value&>(kNull);
37+
const unsigned char& kNullRef = kNull[0];
38+
const Value& Value::null = reinterpret_cast<const Value&>(kNullRef);
3839

3940
const Int Value::minInt = Int(~(UInt(-1) / 2));
4041
const Int Value::maxInt = Int(UInt(-1) / 2);

0 commit comments

Comments
 (0)