Commit 0b96dd41 authored by Carles Cufi's avatar Carles Cufi
Browse files

tests: lib: mpsc_pbuf: Fix address-of-packed-mem warning



The warning below appears once -Waddress-of-packed-mem is enabled:

/__w/zephyr/zephyr/tests/lib/mpsc_pbuf/src/main.c: In function
'item_put_data_overwrite':
/__w/zephyr/zephyr/tests/lib/mpsc_pbuf/src/main.c:497:3: error:
converting a packed 'struct test_data_ext' pointer (alignment 1) to a
'uint32_t' {aka 'const unsigned int'} pointer (alignment 4) may result
in an unaligned pointer value [-Werror=address-of-packed-member]
  497 |   mpsc_pbuf_put_data(&buffer, (uint32_t *)&item, len);

To avoid the warning, as well as several others related to the same
problem, use an intermediate void * variable.

More info in #16587.

Signed-off-by: default avatarCarles Cufi <carles.cufi@nordicsemi.no>
parent cfbaac67
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment