From 607b5752ac5873d68654d77d7bc7ea453d61625e Mon Sep 17 00:00:00 2001 From: Jan Horacek Date: Mon, 6 Jan 2020 22:54:59 +0100 Subject: [PATCH] Use -O0 to avoid segfault. --- lib-api.cpp | 1 + xn.pro | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/lib-api.cpp b/lib-api.cpp index 2a0a92e..4385088 100644 --- a/lib-api.cpp +++ b/lib-api.cpp @@ -235,6 +235,7 @@ void locoAcquiredGotFunc(LocoInfo locoInfo, TrkAcquiredCallback acquired, void * if (acquired != nullptr) acquired(&lib.xn, locoInfo); + // When >O0, segfault happens in the return below (don't know why). } void locoAcquired(LocoAddr addr, TrkAcquiredCallback acquired, LibStdCallback err, diff --git a/xn.pro b/xn.pro index 485f073..2d0aebb 100644 --- a/xn.pro +++ b/xn.pro @@ -55,3 +55,8 @@ DEFINES += "VERSION_MAJOR=$$VERSION_MAJOR" \ #Target version VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR} DEFINES += "VERSION=\\\"$${VERSION}\\\"" + + +#When >=O1, segfault happens in lib-api.cpp +QMAKE_CXXFLAGS_RELEASE -= -O2 +QMAKE_CXXFLAGS_RELEASE += -O0