Skip to content

Commit f97723d

Browse files
author
Matthias Loy
committed
provoke compile error:
"dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing]"
1 parent 1a6426a commit f97723d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/lib_json/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ ELSE(JSONCPP_LIB_BUILD_SHARED)
77
ENDIF(JSONCPP_LIB_BUILD_SHARED)
88

99

10+
if( CMAKE_COMPILER_IS_GNUCXX )
11+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror=strict-aliasing")
12+
endif( CMAKE_COMPILER_IS_GNUCXX )
13+
1014
SET( JSONCPP_INCLUDE_DIR ../../include )
1115

1216
SET( PUBLIC_HEADERS

0 commit comments

Comments
 (0)