File tree 2 files changed +6
-1
lines changed 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,10 @@ ELSE(JSONCPP_LIB_BUILD_SHARED)
7
7
ENDIF (JSONCPP_LIB_BUILD_SHARED)
8
8
9
9
10
+ if ( CMAKE_COMPILER_IS_GNUCXX )
11
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing" )
12
+ endif ( CMAKE_COMPILER_IS_GNUCXX )
13
+
10
14
SET ( JSONCPP_INCLUDE_DIR ../../include )
11
15
12
16
SET ( PUBLIC_HEADERS
Original file line number Diff line number Diff line change @@ -34,7 +34,8 @@ namespace Json {
34
34
#define ALIGNAS (byte_alignment )
35
35
#endif
36
36
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 );
38
39
39
40
const Int Value::minInt = Int (~(UInt (-1 ) / 2 ));
40
41
const Int Value::maxInt = Int (UInt (-1 ) / 2 );
You can’t perform that action at this time.
0 commit comments