Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gcc13 erroneous warning #802

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion include/matx/core/tensor_desc.h
Original file line number Diff line number Diff line change
Expand Up @@ -313,9 +313,14 @@ IGNORE_WARNING_POP_GCC

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

Expand Down