From 4a75b480e99c945c1c9c41669b85c96096da058b Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 14 Aug 2019 00:14:27 +0300 Subject: Fixed BUILD scripts for gcc 6.x Added also -DTRASH_FREE_MEMORY to valgrind builds --- BUILD/SETUP.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'BUILD/SETUP.sh') diff --git a/BUILD/SETUP.sh b/BUILD/SETUP.sh index 57220a3a244..7397fbbd673 100755 --- a/BUILD/SETUP.sh +++ b/BUILD/SETUP.sh @@ -141,7 +141,7 @@ elif [ "x$warning_mode" = "xmaintainer" ]; then debug_extra_cflags="-g3" else # Both C and C++ warnings - warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing -Wimplicit-fallthrough=2" + warnings="-Wall -Wextra -Wunused -Wwrite-strings -Wno-uninitialized -Wno-strict-aliasing" # For more warnings, uncomment the following line # warnings="$warnings -Wshadow" @@ -160,7 +160,10 @@ fi # Override -DFORCE_INIT_OF_VARS from debug_cflags. It enables the macro # UNINIT_VAR(), which is only useful for silencing spurious warnings # of static analysis tools. We want UNINIT_VAR() to be a no-op in Valgrind. -valgrind_flags="-DHAVE_valgrind -USAFEMALLOC" +# TRASH_FREE_MEMORY is enabled so that we can find wrong memory accesses +# even when running a test without valgrind +# +valgrind_flags="-DHAVE_valgrind -USAFEMALLOC -DTRASH_FREE_MEMORY" valgrind_flags="$valgrind_flags -UFORCE_INIT_OF_VARS -Wno-uninitialized" valgrind_flags="$valgrind_flags -DMYSQL_SERVER_SUFFIX=-valgrind-max" valgrind_configs="--with-valgrind" @@ -252,6 +255,11 @@ if test `$CC -v 2>&1 | tail -1 | sed 's/ .*$//'` = 'gcc' ; then then debug_cflags="$debug_cflags -DFORCE_INIT_OF_VARS -Wuninitialized" fi + if (test '(' "$GCCV1" -gt '6' ')') + then + c_warnings="$c_warnings -Wimplicit-fallthrough=2" + cxx_warnings="$cxx_warnings -Wimplicit-fallthrough=2" + fi fi -- cgit v1.2.1