You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After #7746 merged, the compile with our esp-riscv-toolchain fails. The error information shows
../third_party/connectedhomeip/src/app/clusters/door-lock-server/door-lock-server-user.cpp:248:75: error: call of overloaded 'Put(uint64_t, EmberAfDoorLockUserType&)' is ambiguous
../third_party/connectedhomeip/src/app/clusters/door-lock-server/door-lock-server-user.cpp:394:76: error: call of overloaded 'Put(uint64_t, EmberAfDoorLockUserStatus&)' is ambiguous
../third_party/connectedhomeip/src/app/clusters/door-lock-server/door-lock-server-schedule.cpp:506:94: error: call of overloaded 'Put(uint64_t, EmberAfDoorLockOperatingMode&)' is ambiguous
Compile this file test_enum.txt using the command g++ test_enum.cpp and we will get the following results:
input is int32
input is int32
input is uint32
It seems that the enumerations will be cast to int instead of their underlying types if their storage width are not 32-bits.
Then the error of overload ambiguous will appear when int32_t is defined as long(such as our esp-riscv-toolchain and arm-none-eabi-toolchain) and disappear when int32_t is defined as int.
Considering that the resulting TLV just depends on the value passed in and whether it was signed or unsigned, the wrong TLVWriter::Put will be called with a unsigned 8-bits(or 16-bits) value passed in.
The text was updated successfully, but these errors were encountered:
Problem
After #7746 merged, the compile with our esp-riscv-toolchain fails. The error information shows
Compile this file test_enum.txt using the command
g++ test_enum.cpp
and we will get the following results:It seems that the enumerations will be cast to
int
instead of their underlying types if their storage width are not 32-bits.Then the error of
overload ambiguous
will appear whenint32_t
is defined aslong
(such as our esp-riscv-toolchain and arm-none-eabi-toolchain) and disappear whenint32_t
is defined asint
.Considering that the resulting TLV just depends on the value passed in and whether it was signed or unsigned, the wrong
TLVWriter::Put
will be called with a unsigned 8-bits(or 16-bits) value passed in.The text was updated successfully, but these errors were encountered: