diff --git a/src/lib/format/tests/TestDecoding.cpp b/src/lib/format/tests/TestDecoding.cpp index f9ef31719f5b6b..3c6edd3000fa3a 100644 --- a/src/lib/format/tests/TestDecoding.cpp +++ b/src/lib/format/tests/TestDecoding.cpp @@ -34,7 +34,12 @@ using namespace chip::TLV; using namespace chip::TLVMeta; using namespace chip::TestData; -const Entry _empty_item[0] = {}; +// size 1 to avoid compilers complaining about empty arrays +// (not allowed by ISO 9899:2011 6.7.6.2: +// If the expression is a constant expression, it shall have a value greater +// than zero. +// ). We still claim its size is 0 in empty_meta though. +const Entry _empty_item[1] = {}; const std::array, 1> empty_meta = { { { 0, _empty_item } } }; const Entry _FakeProtocolData[] = {