mirror of
https://github.com/torvalds/linux.git
synced 2026-08-04 06:20:44 +02:00
Accessing 'reg.write_index' directly triggers a -Waddress-of-packed-member
warning due to potential unaligned pointer access:
perf_test.c:239:38: warning: taking address of packed member 'write_index'
of class or structure 'user_reg' may result in an unaligned pointer value
[-Waddress-of-packed-member]
239 | ASSERT_NE(-1, write(self->data_fd, ®.write_index,
| ^~~~~~~~~~~~~~~
Since write(2) works with any alignment. Casting '®.write_index'
explicitly to 'void *' to suppress this warning.
Link: https://lkml.kernel.org/r/20251106095532.15185-1-ankitkhushwaha.linux@gmail.com
Fixes:
|
||
|---|---|---|
| .. | ||
| .gitignore | ||
| abi_test.c | ||
| config | ||
| dyn_test.c | ||
| ftrace_test.c | ||
| Makefile | ||
| perf_test.c | ||
| settings | ||
| user_events_selftests.h | ||