summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Bostic <keith.bostic@mongodb.com>2017-03-16 11:42:07 -0400
committerGitHub <noreply@github.com>2017-03-16 11:42:07 -0400
commit6a3ee4ea9986ff2a7446c4774b04423673165c57 (patch)
treead977680eb7432bf3350e51581b19746e7f87304
parent6203106c56504f194bab7093b28c45ae7beb9cac (diff)
downloadmongo-6a3ee4ea9986ff2a7446c4774b04423673165c57.tar.gz
WT-3225 WiredTiger won't build with clang on CentOS 7.3.1611 (#3333)
* WT-3225 WiredTiger won't build with clang on CentOS 7.3.1611 Casting the call's return to int is because CentOS 7.3.1611 complains about syscall returning a long and the loss of integer precision in the assignment to ret. The cast should be a no-op everywhere. * On Centos 7.3.1611, system header files aren't compatible with -Wdisabled-macro-expansion. I don't see a big reason for having that warning, so I'm turning it off generally. Add -Wuninitialized to WiredTiger's gcc builds.
-rw-r--r--build_posix/aclocal/strict.m45
-rw-r--r--dist/s_string.ok2
-rw-r--r--src/include/os.h8
3 files changed, 14 insertions, 1 deletions
diff --git a/build_posix/aclocal/strict.m4 b/build_posix/aclocal/strict.m4
index c107dd017d7..659867fa69e 100644
--- a/build_posix/aclocal/strict.m4
+++ b/build_posix/aclocal/strict.m4
@@ -31,6 +31,7 @@ AC_DEFUN([AM_GCC_WARNINGS], [
w="$w -Wstrict-prototypes"
w="$w -Wswitch-enum"
w="$w -Wundef"
+ w="$w -Wuninitialized"
w="$w -Wunreachable-code"
w="$w -Wunsafe-loop-optimizations"
w="$w -Wunused"
@@ -66,6 +67,10 @@ AC_DEFUN([AM_CLANG_WARNINGS], [
# w="$w -Wno-error=cast-qual"
w="$w -Wno-cast-qual"
+ # On Centos 7.3.1611, system header files aren't compatible with
+ # -Wdisabled-macro-expansion.
+ w="$w -Wno-disabled-macro-expansion"
+
case "$1" in
*Apple*clang*version*4.1*)
# Apple clang has its own numbering system, and older OS X
diff --git a/dist/s_string.ok b/dist/s_string.ok
index cdfa4aec968..39b6b163cd9 100644
--- a/dist/s_string.ok
+++ b/dist/s_string.ok
@@ -68,6 +68,7 @@ CURSORs
CURSTD
CallsCustDate
Castagnoli
+CentOS
Checkpointing
Checksum
Checksums
@@ -1148,6 +1149,7 @@ sw
sx
sy
sys
+syscall
sz
t's
tV
diff --git a/src/include/os.h b/src/include/os.h
index 7a8e47ed81f..8505649a1fd 100644
--- a/src/include/os.h
+++ b/src/include/os.h
@@ -11,8 +11,14 @@
* A call returning 0 indicates success; any call where \
* 0 is not the only successful return must provide an \
* expression evaluating to 0 in all successful cases. \
+ * \
+ * XXX \
+ * Casting the call's return to int is because CentOS 7.3.1611 \
+ * complains about syscall returning a long and the loss of \
+ * integer precision in the assignment to ret. The cast should \
+ * be a no-op everywhere. \
*/ \
- if (((ret) = (call)) == 0) \
+ if (((ret) = (int)(call)) == 0) \
break; \
/* \
* The call's error was either returned by the call or \