Skip to content

Commit

Permalink
Use -O0 to avoid segfault.
Browse files Browse the repository at this point in the history
  • Loading branch information
horacekj committed Jan 6, 2020
1 parent 87641c9 commit 607b575
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib-api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
5 changes: 5 additions & 0 deletions xn.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 607b575

Please sign in to comment.