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: Carles Cufi <carles.cufi@nordicsemi.no>
|
||
|---|---|---|
| .. | ||
| application_development/gen_inc_file | ||
| arch | ||
| benchmarks | ||
| bluetooth | ||
| boards | ||
| boot/uefi | ||
| cmake/config_dir | ||
| crypto | ||
| drivers | ||
| kernel | ||
| lib | ||
| misc | ||
| net | ||
| posix | ||
| subsys | ||
| unit | ||
| ztest | ||