From 3285e21cfd0ea0c9c89e1143421d07029e098790 Mon Sep 17 00:00:00 2001 From: Pieter Wuille Date: Tue, 26 Jun 2018 17:54:27 -0700 Subject: [PATCH] Merge #12686: Add -ftrapv to CFLAGS and CXXFLAGS when --enable-debug is used. Enable -ftrapv in Travis. 98d842cb52 travis: Build with --enable-debug (x86_64-unknown-linux-gnu) (practicalswift) 94e52d13db Add -ftrapv to DEBUG_CXXFLAGS when --enable-debug is used (practicalswift) Pull request description: By generating a trap for signed overflow on addition, subtraction, multiplication operations in the Travis testing we are more likely to identify problematic code prior to merging it. Tree-SHA512: 47712da53b4ff451b8f22f16ddc3b53100a09060a3b04cda4b8fbbb74e6f666fc07a9cc7abc64cacb87a0aa3f62dc8e3c91a1a0ed12bf82bb2a5624a5d104389 --- configure.ac | 1 + 1 file changed, 1 insertion(+) diff --git a/configure.ac b/configure.ac index 7b988610c0..7a439b38ff 100644 --- a/configure.ac +++ b/configure.ac @@ -331,6 +331,7 @@ if test "x$enable_debug" = xyes; then AX_CHECK_PREPROC_FLAG([-DDEBUG_CORE],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_CORE"]],,[[$CXXFLAG_WERROR]]) AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"]],,[[$CXXFLAG_WERROR]]) + AX_CHECK_COMPILE_FLAG([-ftrapv],[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"],,[[$CXXFLAG_WERROR]]) else # We always enable at at least -g1 debug info to support proper stacktraces in crash infos # Stacktraces will be suboptimal due to optimization, but better than nothing. Also, -fno-omit-frame-pointer