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 16:08:48 UTC
[GitHub] [incubator-mxnet] leezu commented on a change in pull request #18484: MXNET-1452: fix compiler warnings
leezu commented on a change in pull request #18484:
URL: https://github.com/apache/incubator-mxnet/pull/18484#discussion_r435377614
##########
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:
Warray-bounds warns about subscripts to arrays that are always out of bounds. Is there any evidence for GCC being wrong and the subscript being in bounds?
----------------------------------------------------------------
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