Skip to content
This repository was archived by the owner on Nov 17, 2023. It is now read-only.

Commit 6d1d122

Browse files
committed
compiler warnings
1 parent 8063182 commit 6d1d122

File tree

4 files changed

+12
-3
lines changed

4 files changed

+12
-3
lines changed

3rdparty/mshadow/mshadow/logging.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,12 @@ class LogMessageFatal {
204204
~LogMessageFatal() MSHADOW_THROW_EXCEPTION {
205205
// throwing out of destructor is evil
206206
// hopefully we can do it here
207+
#pragma GCC diagnostic push
208+
#if __GNUC__ >= 7
209+
#pragma GCC diagnostic ignored "-Wterminate"
210+
#endif
207211
throw Error(log_stream_.str());
212+
#pragma GCC diagnostic pop
208213
}
209214

210215
private:

3rdparty/mshadow/mshadow/packet-inl.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,11 @@ inline void* AlignedMallocPitch(size_t *out_pitch,
7474
if (res == NULL) {
7575
LOG(FATAL) << "AlignedMallocPitch failed";
7676
}
77+
#if __GNUC__ >= 6
78+
#pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
79+
#endif
7780
return res;
81+
#pragma GCC diagnostic pop
7882
}
7983

8084
/*!

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ CFLAGS += -DDMLC_LOG_STACK_TRACE_SIZE=0
101101
CFLAGS += -DDMLC_LOG_FATAL_THROW=1
102102

103103
ifeq ($(DEV), 1)
104-
CFLAGS += -g -Werror
104+
# Excluded from Werror:
105+
# 1) variables used in '#pragma omp parallel' are considered unused
106+
CFLAGS += -g -Werror -Wno-error=unused-variable -Wno-error=maybe-uninitialized -Wno-error=unused-function
105107
NVCCFLAGS += -Werror cross-execution-space-call
106108
endif
107109

ci/docker/runtime_functions.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,6 @@ build_ubuntu_gpu_cuda101_cudnn7_make() {
796796
export CXX=g++-7
797797
build_ccache_wrappers
798798
make \
799-
DEV=1 \
800799
USE_BLAS=openblas \
801800
USE_MKLDNN=0 \
802801
USE_CUDA=1 \
@@ -817,7 +816,6 @@ build_ubuntu_gpu_cuda101_cudnn7_mkldnn_cpp_test() {
817816
export CXX=g++-7
818817
build_ccache_wrappers
819818
make \
820-
DEV=1 \
821819
USE_BLAS=openblas \
822820
USE_MKLDNN=1 \
823821
USE_CUDA=1 \

0 commit comments

Comments
 (0)