From 6d1d1220bb4b59b51640729ad7593d11b477fb44 Mon Sep 17 00:00:00 2001 From: Leonard Lausen Date: Tue, 7 Apr 2020 01:36:27 +0000 Subject: [PATCH] compiler warnings --- 3rdparty/mshadow/mshadow/logging.h | 5 +++++ 3rdparty/mshadow/mshadow/packet-inl.h | 4 ++++ Makefile | 4 +++- ci/docker/runtime_functions.sh | 2 -- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/3rdparty/mshadow/mshadow/logging.h b/3rdparty/mshadow/mshadow/logging.h index 5fc56aff3bae..6aede0d69725 100644 --- a/3rdparty/mshadow/mshadow/logging.h +++ b/3rdparty/mshadow/mshadow/logging.h @@ -204,7 +204,12 @@ class LogMessageFatal { ~LogMessageFatal() MSHADOW_THROW_EXCEPTION { // throwing out of destructor is evil // hopefully we can do it here +#pragma GCC diagnostic push +#if __GNUC__ >= 7 +#pragma GCC diagnostic ignored "-Wterminate" +#endif throw Error(log_stream_.str()); +#pragma GCC diagnostic pop } private: diff --git a/3rdparty/mshadow/mshadow/packet-inl.h b/3rdparty/mshadow/mshadow/packet-inl.h index 58cbc4005aaf..69a41b50e08a 100644 --- a/3rdparty/mshadow/mshadow/packet-inl.h +++ b/3rdparty/mshadow/mshadow/packet-inl.h @@ -74,7 +74,11 @@ inline void* AlignedMallocPitch(size_t *out_pitch, if (res == NULL) { LOG(FATAL) << "AlignedMallocPitch failed"; } +#if __GNUC__ >= 6 +#pragma GCC diagnostic ignored "-Wmaybe-uninitialized" +#endif return res; +#pragma GCC diagnostic pop } /*! diff --git a/Makefile b/Makefile index b8634140b4be..ed19e69390bd 100644 --- a/Makefile +++ b/Makefile @@ -101,7 +101,9 @@ CFLAGS += -DDMLC_LOG_STACK_TRACE_SIZE=0 CFLAGS += -DDMLC_LOG_FATAL_THROW=1 ifeq ($(DEV), 1) - CFLAGS += -g -Werror + # Excluded from Werror: + # 1) variables used in '#pragma omp parallel' are considered unused + CFLAGS += -g -Werror -Wno-error=unused-variable -Wno-error=maybe-uninitialized -Wno-error=unused-function NVCCFLAGS += -Werror cross-execution-space-call endif diff --git a/ci/docker/runtime_functions.sh b/ci/docker/runtime_functions.sh index 9817efb7323d..ae7613513df7 100755 --- a/ci/docker/runtime_functions.sh +++ b/ci/docker/runtime_functions.sh @@ -796,7 +796,6 @@ build_ubuntu_gpu_cuda101_cudnn7_make() { export CXX=g++-7 build_ccache_wrappers make \ - DEV=1 \ USE_BLAS=openblas \ USE_MKLDNN=0 \ USE_CUDA=1 \ @@ -817,7 +816,6 @@ build_ubuntu_gpu_cuda101_cudnn7_mkldnn_cpp_test() { export CXX=g++-7 build_ccache_wrappers make \ - DEV=1 \ USE_BLAS=openblas \ USE_MKLDNN=1 \ USE_CUDA=1 \