Hi,
after updating my NCS version to v2.1.2 I noticed that my Zephyr SDK also needed updating from 0.14.1 to 0.15.1. However, after updating my Matter project does not compile anymore (and neither do the samples):
In file included from ../../../../../../../modules/lib/matter/src/lib/support/BufferWriter.h:24,
from ../../../../../../../modules/lib/matter/src/system/SystemPacketBuffer.h:32,
from ../../../../../../../modules/lib/matter/src/ble/BleLayer.h:59,
from ../../../../../../../modules/lib/matter/src/lib/core/CHIPCore.h:43,
from ../../../../../../../modules/lib/matter/src/app/MessageDef/InvokeRequestMessage.h:22,
from ../../../../../../../modules/lib/matter/src/app/CommandSender.h:30,
from ../../../../../../../modules/lib/matter/src/controller/CommissioneeDeviceProxy.h:29,
from ../../../../../../../modules/lib/matter/src/controller/AutoCommissioner.h:19,
from ../../../../../../../modules/lib/matter/src/controller/AutoCommissioner.cpp:19:
In member function 'constexpr size_t chip::Span<T>::size() const [with T = const char]',
inlined from 'virtual CHIP_ERROR chip::Controller::AutoCommissioner::SetCommissioningParameters(const chip::Controller::CommissioningParameters&)' at ../../../../../../../modules/lib/matter/src/controller/AutoCommissioner.cpp:111:13:
../../../../../../../modules/lib/matter/src/lib/support/Span.h:73:44: error: dangling pointer to an unnamed temporary may be used [-Werror=dangling-pointer=]
73 | constexpr size_t size() const { return mDataLen; }
Downgrading to Zephyr SDK 0.14.1 fixes the issue.
Seems 0.15.1 uses GCC 12:
arm-zephyr-eabi-g++ (Zephyr SDK 0.15.1) 12.1.0
where 0.14.1 uses GCC 10:
arm-zephyr-eabi-g++ (Zephyr SDK 0.14.1) 10.3.0
Is there anything I forgot to update or change, seems weird that the samples wouldn't build on the standard config...
Kind regards and thanks,
-Alex