From 09b208c53667210638bb56c0241d0f28a10f51b5 Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Wed, 15 Nov 2023 13:39:59 +0100 Subject: [PATCH 1/2] added C flag -fft-contract=off to disable floating point operation contraction causing wrong behaviour on some platforms --- CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 478e1a2fcb..435773d7bc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -57,6 +57,7 @@ if(UNIX) set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -m64") endif() # C compiler flags + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffp-contract=off") # disable floating point operation contraction set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror-implicit-function-declaration -Wno-unused-parameter") -- GitLab From 8ae39095789a8919c995431aa20315d116fbb72f Mon Sep 17 00:00:00 2001 From: Jouni Paulus Date: Wed, 15 Nov 2023 15:16:47 +0100 Subject: [PATCH 2/2] add flag -fft-contract=off also to Makefile --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 8955e04e66..811d38b684 100644 --- a/Makefile +++ b/Makefile @@ -58,7 +58,7 @@ endif CFLAGS += -std=c99 -pedantic -Wcast-qual -Wall -W -Wextra -Wno-long-long \ -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \ -Werror-implicit-function-declaration \ - -Wno-implicit-fallthrough + -Wno-implicit-fallthrough -ffp-contract=off # libs to link LDLIBS += -lm -- GitLab