Skip to content

Commit 5771339

Browse files
authored
Fix gcc13 erroneous warning (#802)
1 parent 6576984 commit 5771339

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/matx/core/tensor_desc.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,14 @@ IGNORE_WARNING_POP_GCC
313313

314314
/* In release mode with O3 on g++ seems to give incorrect warnings on this line from Clone()
315315
and clone(). It appears there's no valid code path that would cause this to be unitialized,
316-
so we're ignoring the warning in this one spot. */
316+
so we're ignoring the warning in this one spot. gcc also incorrectly reports:
317+
error: array subscript 3 is outside array bounds of. This is impossible in the case it's reporting
318+
since it comes from a clone where the loop inside of clone() is a compile-time constant of 2,
319+
so it can never count up to 3. */
317320
IGNORE_WARNING_PUSH_GCC("-Wmaybe-uninitialized")
321+
IGNORE_WARNING_PUSH_GCC("-Warray-bounds")
318322
return *(stride_.begin() + dim);
323+
IGNORE_WARNING_POP_GCC
319324
IGNORE_WARNING_POP_GCC
320325
}
321326

0 commit comments

Comments
 (0)