cJSON

mirror of Dave's cJSON
git clone git://git.thc420.xyz/cJSON
Log | Files | Refs | README | LICENSE

commit 2f65e80a3471d053fdc3f8aed23d01dd1782a5cb
parent ef34500693e8c4a2849d41a4bd66fd19c9ec46c2
Author: Max Bruckner <max@maxbruckner.de>
Date:   Tue, 21 Mar 2017 19:02:55 +0100

Fix internal compiler error in GCC on x86

Diffstat:
Mtests/CMakeLists.txt | 8++++++++
1 file changed, 8 insertions(+), 0 deletions(-)

diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt @@ -17,6 +17,14 @@ if(ENABLE_CJSON_TEST) target_compile_options(unity PRIVATE "-fvisibility=default") endif() endif() + # Disable -fsanitize=float-divide-by-zero for Unity (GCC bug on x86 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80097) + if (FLAG_SUPPORTED_fsanitizefloatdividebyzero AND (CMAKE_C_COMPILER_ID STREQUAL "GNU")) + if ("${CMAKE_VERSION}" VERSION_LESS "2.8.12") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-sanitize=float-divide-by-zero") + else() + target_compile_options(unity PRIVATE "-fno-sanitize=float-divide-by-zero") + endif() + endif() #copy test files file(MAKE_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/inputs")