diff options
author | Keith Bostic <keith.bostic@mongodb.com> | 2016-09-13 21:42:13 -0400 |
---|---|---|
committer | sueloverso <sue@mongodb.com> | 2016-09-13 21:42:13 -0400 |
commit | 09f65fffa7375357264f55f75678540bb7ab5a08 (patch) | |
tree | 3883420c7fba6f32faaa84afb0356f16e700921a | |
parent | bbdd7a8248e80ab41010278b211d042c070b4333 (diff) | |
download | mongo-09f65fffa7375357264f55f75678540bb7ab5a08.tar.gz |
WT-2911 add support for gcc6 (#3037)
* WT-2911 add support for gcc6
* Turn on stronger clang flags except for Apple's clang 4.1.
Another run at getting the quoting right.
* rebalance.c:81:2: error: embedding a directive within macro arguments
has undefined behavior [-Werror,-Wembedded-directive]
* Remove double quotes around string in case statements, it makes bash sad.
-rw-r--r-- | build_posix/aclocal/strict.m4 | 24 | ||||
-rw-r--r-- | build_posix/configure.ac.in | 4 | ||||
-rw-r--r-- | test/format/rebalance.c | 6 |
3 files changed, 23 insertions, 11 deletions
diff --git a/build_posix/aclocal/strict.m4 b/build_posix/aclocal/strict.m4 index 0dbd5dbee16..c107dd017d7 100644 --- a/build_posix/aclocal/strict.m4 +++ b/build_posix/aclocal/strict.m4 @@ -40,6 +40,12 @@ AC_DEFUN([AM_GCC_WARNINGS], [ w="$w -Wno-error=inline" w="$w -Wno-error=unsafe-loop-optimizations" + case "$1" in + [*6.[0-9].[0-9]*]) # gcc6.X + w="$w -Wduplicated-cond" + w="$w -Wmisleading-indentation";; + esac + wt_cv_strict_warnings="$w" ]) @@ -60,13 +66,17 @@ AC_DEFUN([AM_CLANG_WARNINGS], [ # w="$w -Wno-error=cast-qual" w="$w -Wno-cast-qual" - # Older OS X releases need some special love; these flags should be - # removed in the not-too-distant future. - # Apple clang version 4.1 - # (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) - w="$w -Wno-attributes" - w="$w -Wno-pedantic" - w="$w -Wno-unused-command-line-argument" + case "$1" in + *Apple*clang*version*4.1*) + # Apple clang has its own numbering system, and older OS X + # releases need some special love. Turn off some flags for + # Apple's clang 4.1: + # Apple clang version 4.1 + # (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) + w="$w -Wno-attributes" + w="$w -Wno-pedantic" + w="$w -Wno-unused-command-line-argument";; + esac # Ignore unrecognized options. w="$w -Wno-unknown-warning-option" diff --git a/build_posix/configure.ac.in b/build_posix/configure.ac.in index 3526abc8254..608d602937d 100644 --- a/build_posix/configure.ac.in +++ b/build_posix/configure.ac.in @@ -38,9 +38,9 @@ if test "$wt_cv_enable_strict" = "yes"; then wt_cv_cc_version="`$CC --version | sed -eq`" case "$wt_cv_cc_version" in *clang*) - AM_CLANG_WARNINGS;; + AM_CLANG_WARNINGS($wt_cv_cc_version);; *cc*|*CC*) # cc, CC, gcc, GCC - AM_GCC_WARNINGS;; + AM_GCC_WARNINGS($wt_cv_cc_version);; *) AC_MSG_ERROR( [--enable-strict does not support "$wt_cv_cc_version".]);; diff --git a/test/format/rebalance.c b/test/format/rebalance.c index 5fd86ef3317..9849b7df82b 100644 --- a/test/format/rebalance.c +++ b/test/format/rebalance.c @@ -73,12 +73,14 @@ wts_rebalance(void) testutil_checkfmt(system(cmd), "command failed: %s", cmd); /* Compare the old/new versions of the object. */ - (void)snprintf(cmd, sizeof(cmd), #ifdef _WIN32 + (void)snprintf(cmd, sizeof(cmd), "fc /b %s\\rebalance.orig %s\\rebalance.new > NUL", + g.home, g.home); #else + (void)snprintf(cmd, sizeof(cmd), "cmp %s/rebalance.orig %s/rebalance.new > /dev/null", -#endif g.home, g.home); +#endif testutil_checkfmt(system(cmd), "command failed: %s", cmd); } |