Skip to content
This repository was archived by the owner on Dec 12, 2024. It is now read-only.

Commit 4e501d8

Browse files
marbreDavid Ronnenberg
andauthored
Fix gcc warnings (#34)
GCC moans that e.g. `struct std::array<long unsigned int, 1>` has no user-provided default constructor. and the implicitly-defined constructor does not initialize `long unsigned int std::array<long unsigned int, 1>::_M_elems [1]`. This fixes the warnings. Co-authored-by: David Ronnenberg <[email protected]>
1 parent b9e2ab8 commit 4e501d8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎include/emitc/emitc_types.h‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class Tensor {
102102
}
103103

104104
static constexpr std::array<size_t, rank()> strides() {
105-
std::array<size_t, rank()> result;
105+
std::array<size_t, rank()> result = {};
106106
constexpr std::array<size_t, rank()> s = {Shape...};
107107

108108
if (rank() == 0) {
@@ -132,7 +132,7 @@ class Tensor {
132132
int resultSize =
133133
std::accumulate(sizes.begin(), sizes.end(), 1, std::multiplies<int>{});
134134
for (int n = 0; n < resultSize; ++n) {
135-
std::array<size_t, rank()> u;
135+
std::array<size_t, rank()> u = {};
136136
div_t q{n, 0};
137137
for (int i = iotas.size() - 1; 0 <= i; --i) {
138138
q = div(q.quot, iotas[i].size());
@@ -194,7 +194,7 @@ class Tensor {
194194

195195
std::array<size_t, rank()> s = strides();
196196

197-
std::array<size_t, rank()> result;
197+
std::array<size_t, rank()> result = {};
198198
for (size_t i = 0; i < rank(); i++) {
199199
result[i] = index / s[i];
200200
index = index % s[i];

0 commit comments

Comments
 (0)