From 48d9a92a1b4621e69533af543c1f0611abc47ddc Mon Sep 17 00:00:00 2001 From: Matthias Loy Date: Wed, 13 Aug 2014 13:20:29 +0200 Subject: [PATCH] do intermediate step in order to omit "dereferencing type-punned pointer" error --- src/lib_json/json_value.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib_json/json_value.cpp b/src/lib_json/json_value.cpp index 0010f6f..637016f 100644 --- a/src/lib_json/json_value.cpp +++ b/src/lib_json/json_value.cpp @@ -34,7 +34,8 @@ namespace Json { #define ALIGNAS(byte_alignment) #endif static const unsigned char ALIGNAS(8) kNull[sizeof(Value)] = {0}; -const Value& Value::null = reinterpret_cast(kNull); +const unsigned char& kNullRef = kNull[0]; +const Value& Value::null = reinterpret_cast(kNullRef); const Int Value::minInt = Int(~(UInt(-1) / 2)); const Int Value::maxInt = Int(UInt(-1) / 2);