Zephyr: Build error: (Bluetooth: Mesh: split prov.c into two separate modules #28457)

Created on 29 Oct 2020  路  1Comment  路  Source: zephyrproject-rtos/zephyr

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):

  • OS: Windows 10
  • GNU Arm Embedded Toolchain: Version 9-2020-q2-update
  • C2.4.99 just merged latest changes
Bluetooth Bluetooth Mesh bug low

Most helpful comment

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.

>All comments

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DeltaEvo picture DeltaEvo  路  4Comments

ghost picture ghost  路  3Comments

JusbeR picture JusbeR  路  5Comments

akansal1 picture akansal1  路  4Comments

qianfan-Zhao picture qianfan-Zhao  路  3Comments