dmlc / dmlc-core

A common bricks library for building scalable and portable distributed machine learning.
Apache License 2.0
864 stars 520 forks source link

Disable GCC v6+ -Wmaybe-uninitialized in optional.h #596

Closed leezu closed 4 years ago

leezu commented 4 years ago

Triggered by

https://github.com/apache/incubator-mxnet/blob/c2e9a885683774f229eebdcf2699f51bc3afb3d9/src/operator/tensor/matrix_op-inl.h#L1470-L1505

Warning

In file included from ../include/dmlc/./parameter.h:29,
                 from ../include/dmlc/registry.h:14,
                 from ../include/mxnet/operator_util.h:37,
                 from ../src/operator/tensor/./matrix_op-inl.h:28,
                 from ../src/operator/tensor/matrix_op.cc:26:
../include/dmlc/././optional.h: In function ‘void mxnet::op::SliceLikeInferRanges(const mxnet::TShape&, const mxnet::TShape&, const mxnet::Tuple<int>&, mxnet::Tuple<dmlc::optional<int> >*, mxnet::Tuple<dmlc::optional<int> >*, mxnet::Tuple<dmlc::optional<int> >*)’:
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +20)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       new (&val) T(other.value());
       ^~~
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +28)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +36)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +20)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       new (&val) T(other.value());
       ^~~
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +28)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +36)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +20)’ may be used uninitialized in this function [-Wmaybe-uninitialized]
       new (&val) T(other.value());
       ^~~
../include/dmlc/././optional.h:56:7: warning: ‘*((void*)&<anonymous> +28)’ may be used uninitialized in this function [-Wmaybe-uninitialized]