Commit ddc92d09 authored by Aleksy Barcz's avatar Aleksy Barcz

compile with -fno-strict-aliasing

+ with -O2, -fstrict-aliasing is enabled by default, which may cause undefined behavior (since C2011) when we dereference e.g. uint16_t[4] as a double
+ avoid undefined behavior by disabling this optimisation
+ in the future it would be probably better to use standard-supported methods for conversions (to be determined)
parent a3dd7e00
......@@ -12,7 +12,7 @@ function(CHECK_CXX14)
set(CMAKE_CXX_FLAGS ${CXX14_FLAG} PARENT_SCOPE)
endfunction()
set(GXX_ADDITIONAL_FLAGS "-O2 -g -ggdb -fstack-protector-strong -Wall -D_FORTIFY_SOURCE=2") # -fPIC is added differently, -DPIC is unknown by g++
set(GXX_ADDITIONAL_FLAGS "-O2 -g -ggdb -fno-strict-aliasing -fstack-protector-strong -Wall -D_FORTIFY_SOURCE=2") # -fPIC is added differently, -DPIC is unknown by g++
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${GXX_ADDITIONAL_FLAGS}")
# GCC has this options, clang doesn't
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment