diff options
author | Monty <monty@mariadb.org> | 2019-08-14 00:14:27 +0300 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2019-08-23 22:03:54 +0200 |
commit | 4a75b480e99c945c1c9c41669b85c96096da058b (patch) | |
tree | b86a49d5d8d3e2cf5df73dba52b319c4570df054 /BUILD | |
parent | e6bad1c75dd3207f60afc42f8ec227ef8cef2cb4 (diff) | |
download | mariadb-git-4a75b480e99c945c1c9c41669b85c96096da058b.tar.gz |
Fixed BUILD scripts for gcc 6.x
Added also -DTRASH_FREE_MEMORY to valgrind builds
Diffstat (limited to 'BUILD')
-rwxr-xr-x | BUILD/SETUP.sh | 12 |
1 files changed, 10 insertions, 2 deletions
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 |