Skip to content

Commit 8dfcb01

Browse files
authored
Fix compiler warnings in a few places (#10165)
Summary: There are two places that are emitting warnings, causing builds with -Werror to fail. Neither are correctness issues, but this PR cleans them up to enable build with -Werror. Differential Revision: D72996608 cc @larryliu0820 @JacobSzwejbka @lucylq
1 parent bb22d63 commit 8dfcb01

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

runtime/core/exec_aten/testing_util/tensor_factory.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ inline bool check_dim_order(
133133
size_t gauss_sum = 0;
134134
std::vector<int> count(dim_order.size(), 0);
135135
for (int i = 0; i < dim_order.size(); i++) {
136-
if (dim_order[i] < 0 || dim_order[i] >= sizes.size()) {
136+
if (dim_order[i] >= sizes.size()) {
137137
return false;
138138
}
139139
gauss_sum += static_cast<size_t>(dim_order[i]) + 1;

test/utils/DeathTest.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515

1616
#include <gtest/gtest.h>
1717

18+
#ifndef ET_BUILD_MODE_COV
19+
#define ET_BUILD_MODE_COV 0
20+
#endif // ET_BUILD_MODE_COV
21+
1822
#if ET_BUILD_MODE_COV
1923

2024
/**

0 commit comments

Comments
 (0)