Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not allow zero size array in test #27973

Merged
merged 1 commit into from
Jul 14, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/lib/format/tests/TestDecoding.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ using namespace chip::TLV;
using namespace chip::TLVMeta;
using namespace chip::TestData;

const Entry<ItemInfo> _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<ItemInfo> _empty_item[1] = {};
const std::array<const Node<ItemInfo>, 1> empty_meta = { { { 0, _empty_item } } };

const Entry<ItemInfo> _FakeProtocolData[] = {
Expand Down