In DEBUG mode, make toxcore crash on signed integer overflow.

Signed overflow is undefined behaviour, so in debug mode, we want to make
it fail in a noisy way.
This commit is contained in:
iphydf
2018-06-08 23:48:40 +00:00
parent 8a4a5c2aa2
commit cf9caa069a
+2
View File
@@ -115,6 +115,8 @@ if(NOT MSVC)
# Allows wine to display source code file names and line numbers on crash in its backtrace
add_flag("-gdwarf-2")
endif()
# Crash on signed integer overflow.
add_flag("-ftrapv")
endif()
option(WARNINGS "Enable additional compiler warnings" ON)