Skip to content

Commit 4793e1a

Browse files
gchateletMizux
authored andcommitted
Zero-length arrays are non-standard (#4900)
zero-length arrays is a GNU C extension and fails to compile on Windows.
1 parent d8d50ba commit 4793e1a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ortools/algorithms/space_saving_most_frequent_test.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
#include "ortools/algorithms/space_saving_most_frequent.h"
1515

16+
#include <array>
1617
#include <cstddef>
1718
#include <cstdint>
1819
#include <functional>
@@ -473,7 +474,7 @@ struct Element {
473474
Element() = default;
474475
explicit Element(int value) : value(value) {}
475476
int value;
476-
int zeros[kElementSize] = {};
477+
std::array<int, kElementSize> zeros;
477478
template <typename H>
478479
friend H AbslHashValue(H h, const Element& e) {
479480
return H::combine(std::move(h), e.value);

0 commit comments

Comments
 (0)