Bluetooth: mesh: suppress clang warning in net.c
struct net_val is a packed struct containing
`struct bt_mesh_key dev_key` member which contains uint32_t
variable inside.
Compiling this code with llvm clang produces the following
warning:
`
error: field dev_key within 'struct net_val' is less aligned
than 'struct bt_mesh_key' and is usually due to 'struct net_val'
being packed, which can lead to unaligned accesses
[-Werror,-Wunaligned-access]
`
However, the `struct bt_mesh_key dev_key` is handled in accordance
to its actual alignment. I.e., it is copied using memcpy() which
prevents any alignment issues.
This commit resolves the following Zephyr issue:
https://github.com/zephyrproject-rtos/zephyr/issues/101144
by suppressing -Wunaligned-access warning
on the `struct net_val` declaration.
Signed-off-by: Ivan Iushkov <ivan.iushkov@nordicsemi.no>
1 file changed