diff --git a/cmake/flags.cmake b/cmake/flags.cmake index 010cb6e08ee7d2089da94624567d1c5968e322b0..4c26366c5acf15ef2f78e282e611ad54b4a62b55 100644 --- a/cmake/flags.cmake +++ b/cmake/flags.cmake @@ -215,8 +215,13 @@ if(APPLE) endif() # On Mac OS X register class specifier is deprecated and will cause warning error on latest clang 10.0 set(COMMON_FLAGS - -Wno-deprecated-register -Werror=format - -Werror=inconsistent-missing-override -Werror=braced-scalar-init) + -Wno-deprecated-register + -Werror=format + -Werror=inconsistent-missing-override + -Werror=braced-scalar-init + -Werror=uninitialized + -Werror=tautological-constant-out-of-range-compare + -Werror=literal-conversion) endif() if(WITH_HETERPS AND WITH_PSLIB) diff --git a/paddle/fluid/framework/new_executor/workqueue/nonblocking_threadpool.h b/paddle/fluid/framework/new_executor/workqueue/nonblocking_threadpool.h index 930de3bdb2df0997fc1772338366b5c01c9765dc..dd4438ba068ac369edc704ab6dbedad8f2f4ffae 100644 --- a/paddle/fluid/framework/new_executor/workqueue/nonblocking_threadpool.h +++ b/paddle/fluid/framework/new_executor/workqueue/nonblocking_threadpool.h @@ -37,7 +37,7 @@ class ThreadPoolTempl { : env_(env), allow_spinning_(allow_spinning), always_spinning_(always_spinning), - global_steal_partition_(EncodePartition(0, num_threads_)), + global_steal_partition_(EncodePartition(0, num_threads)), blocked_(0), num_tasks_(0), done_(false), diff --git a/paddle/fluid/imperative/partial_grad_engine.cc b/paddle/fluid/imperative/partial_grad_engine.cc index b25bb2af0f8e9eae913f0654df4d26818a8e9847..471627e4ca52499001a2ee5e82e504a5fffea475 100644 --- a/paddle/fluid/imperative/partial_grad_engine.cc +++ b/paddle/fluid/imperative/partial_grad_engine.cc @@ -328,7 +328,8 @@ static void FillConstantLike(const VariableWrapper &ref_var, // grad mission // we can't get data_type_ directly. We need to check if we can only use // default data_type for now. - if (ref_var.ForwardDataType() != -1) { + if (ref_var.ForwardDataType() != + static_cast(-1)) { dst_tensor->mutable_data( place, framework::TransToPhiDataType(ref_var.ForwardDataType())); } else { diff --git a/paddle/fluid/operators/interpolate_op.h b/paddle/fluid/operators/interpolate_op.h index dbd27f526bd8560707992cbaf175ed21d2fa1785..ff2d5236d78bb8c66ed9a08b850f8c5cf335affd 100644 --- a/paddle/fluid/operators/interpolate_op.h +++ b/paddle/fluid/operators/interpolate_op.h @@ -502,7 +502,7 @@ HOSTDEVICE inline T cubic_convolution2(T x, T A) { template HOSTDEVICE inline void get_cubic_upsample_coefficients(T coeffs[4], T t) { - T A = -0.75; + T A = static_cast(-0.75); T x1 = t; coeffs[0] = cubic_convolution2(x1 + 1.0, A); diff --git a/paddle/phi/kernels/cpu/lstsq_kernel.cc b/paddle/phi/kernels/cpu/lstsq_kernel.cc index 5542c2ba6e7c5f5be681bc3fff3ae0603bbf1612..6702ea78393fcf2789d6b4f823505e01e9f85141 100644 --- a/paddle/phi/kernels/cpu/lstsq_kernel.cc +++ b/paddle/phi/kernels/cpu/lstsq_kernel.cc @@ -128,7 +128,7 @@ void LstsqKernel(const Context& dev_ctx, // run once the driver, first to get the optimal workspace size int lwork = -1; - T wkopt; + T wkopt = 0.0; ValueType rwkopt; int iwkopt = 0;