Description
When building New BT Mesh Provisioning changes (Bluetooth: Mesh: split prov.c into two separate modules #28457)
To Reproduce
Steps to reproduce the behavior:
Compiled existing, previously working provisioning app.
Expected behavior
Clean compilation
Impact
Unsure potential showstopper as still assessing impact
Logs and console output
In file included from c:\gnu_arm_embedded\arm-none-eabi\include\string.h:180,
from ../../include/bluetooth/bluetooth.h:21,
from ../zephyrNew/subsys/bluetooth/mesh/prov.c:17:
../zephyrNew/subsys/bluetooth/mesh/prov.c: In function 'bt_mesh_prov_reset_state':
../zephyrNew/subsys/bluetooth/mesh/prov.c:61:2: warning: '__builtin_memset' offset [52, 292] from the object at 'bt_mesh_prov_link' is out of the bounds of referenced subobject 'dhkey' with type 'uint8_t[32]' {aka 'unsigned char[32]'} at offset 19 [-Warray-bounds]
61 | memset(&bt_mesh_prov_link.dhkey, 0,
Environment (please complete the following information):
I'm actually not able to reproduce this with this version of gcc, neither with -Warray-bounds or -Wall -Wextra, and CI isn't catching this either. Could you please share your compiler flags and confirm the compiler version?
Anyway, it looks like a false positive from the compiler, as it expects us to keep within the bounds of the array parameter, which isn't what we're actually trying to do.
Lingao's PR should fix it.
Most helpful comment
I'm actually not able to reproduce this with this version of gcc, neither with
-Warray-boundsor-Wall -Wextra, and CI isn't catching this either. Could you please share your compiler flags and confirm the compiler version?Anyway, it looks like a false positive from the compiler, as it expects us to keep within the bounds of the array parameter, which isn't what we're actually trying to do.
Lingao's PR should fix it.