You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2020/06/04 17:12:22 UTC
[GitHub] [incubator-mxnet] olk commented on a change in pull request #18484: MXNET-1452: fix compiler warnings
olk commented on a change in pull request #18484:
URL: https://github.com/apache/incubator-mxnet/pull/18484#discussion_r435417250
##########
File path: 3rdparty/mshadow/mshadow/tensor.h
##########
@@ -89,15 +89,33 @@ struct Shape {
* \return the corresponding dimension size
*/
MSHADOW_XINLINE index_t &operator[](int idx) {
+// two possible solutions: throw exception if idx is out of bounds
+// --> costs runtime performance
+// disable warning and let the user take care
+// --> UB possible if user doesn't take care
+#pragma GCC diagnostic push
+#if __GNUC__ >= 8
+#pragma GCC diagnostic ignored "-Warray-bounds"
Review comment:
My understanding was that it checks out-of-range access at runtime, it seams that I'm wrong.
But then there is a possible flaw in MXNet, because the compiler has had detected an out-of-range access at compile-time (meaning from the MXNet sources itself).
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org