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

Empty lists in YAML test lead to compilation errors. #11495

Closed
rcasallas-silabs opened this issue Nov 5, 2021 · 0 comments · Fixed by #11496
Closed

Empty lists in YAML test lead to compilation errors. #11495

rcasallas-silabs opened this issue Nov 5, 2021 · 0 comments · Fixed by #11496
Assignees

Comments

@rcasallas-silabs
Copy link
Contributor

Problem

Empty lists in the YAML tests generates code that fails to compile, for instance:

    - label: "Get Group Membership"
      command: "GetGroupMembership"
      arguments:
          values:
              - name: "groupList"
                value: []

Results in:

g++ -MMD -MF obj/chip-tool.main.cpp.o.d -Wconversion -target x86_64-apple-macos10.15 -O0 -g2 -fno-common -ffunction-sections -fdata-sections -fno-exceptions -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -Wall -Werror -Wextra -Wshadow -Wunreachable-code -Wvla -Wno-deprecated-declarations -Wno-unknown-warning-option -Wno-maybe-uninitialized -Wno-missing-field-initializers -Wno-unused-parameter -Wno-psabi -Wno-cast-function-type -fdiagnostics-color -fno-strict-aliasing -I/usr/local/Cellar/[email protected]/1.1.1l/include -fobjc-arc -std=gnu++14 -fno-rtti -Wnon-virtual-dtor -DCONFIG_USE_SEPARATE_EVENTLOOP=true -DCHIP_HAVE_CONFIG_H=1 -I../../../../examples/chip-tool -I../../../../examples/chip-tool/third_party/connectedhomeip/zzz_generated/chip-tool -I../../../../examples/chip-tool/third_party/connectedhomeip/zzz_generated/controller-clusters -I../../../../examples/chip-tool/third_party/connectedhomeip/src/include -I../../../../examples/chip-tool/third_party/connectedhomeip/src -Igen/include -I../../../../examples/chip-tool/third_party/connectedhomeip/zzz_generated/app-common -I../../../../examples/chip-tool/third_party/connectedhomeip/config/standalone -I../../../../examples/chip-tool/third_party/connectedhomeip/third_party/nlassert/repo/include -I../../../../examples/chip-tool/third_party/connectedhomeip/third_party/nlio/repo/include -I../../../../examples/chip-tool/third_party/connectedhomeip/zzz_generated -I../../../../examples/chip-tool/third_party/connectedhomeip/third_party/inipp/repo/inipp -c ../../../../examples/chip-tool/main.cpp -o obj/chip-tool.main.cpp.o
In file included from ../../../../examples/chip-tool/main.cpp:27:
../../../../examples/chip-tool/third_party/connectedhomeip/zzz_generated/chip-tool/zap-generated/test/Commands.h:27882:27: error: no viable overloaded '='
        request.groupList = groupListList;
        ~~~~~~~~~~~~~~~~~ ^ ~~~~~~~~~~~~~
../../../../examples/chip-tool/third_party/connectedhomeip/src/app/data-model/List.h:39:8: note: candidate function (the implicit copy assignment operator) not viable: no known conversion from 'uint16_t [0]' to 'const chip::app::DataModel::List<const unsigned short>' for 1st argument
struct List : public Span<T>
       ^
../../../../examples/chip-tool/third_party/connectedhomeip/src/app/data-model/List.h:39:8: note: candidate function (the implicit move assignment operator) not viable: no known conversion from 'uint16_t [0]' to 'chip::app::DataModel::List<const unsigned short>' for 1st argument
../../../../examples/chip-tool/third_party/connectedhomeip/src/app/data-model/List.h:53:22: note: candidate template ignored: substitution failure [with N = 0]: zero-length arrays are not permitted in C++
    constexpr List & operator=(T (&databuf)[N])
                     ^                      ~
1 error generated.

Proposed Solution

None yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants