We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4debdf1 commit 1605028Copy full SHA for 1605028
src/lib/format/tests/TestDecoding.cpp
@@ -34,7 +34,12 @@ using namespace chip::TLV;
34
using namespace chip::TLVMeta;
35
using namespace chip::TestData;
36
37
-const Entry<ItemInfo> _empty_item[0] = {};
+// size 1 to avoid compilers complaining about empty arrays
38
+// (not allowed by ISO 9899:2011 6.7.6.2:
39
+// If the expression is a constant expression, it shall have a value greater
40
+// than zero.
41
+// ). We still claim its size is 0 in empty_meta though.
42
+const Entry<ItemInfo> _empty_item[1] = {};
43
const std::array<const Node<ItemInfo>, 1> empty_meta = { { { 0, _empty_item } } };
44
45
const Entry<ItemInfo> _FakeProtocolData[] = {
0 commit comments