From: Luca Boccassi Date: Tue, 20 May 2025 13:50:22 +0000 (+0100) Subject: {pidfd,cgroup}-util: avoid alignment warning when accessing f_handle (#37520) X-Git-Tag: v258-rc1~566 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=27ffdb6d9e4956a75e03f6e7728e251ec56ba46d;p=thirdparty%2Fsystemd.git {pidfd,cgroup}-util: avoid alignment warning when accessing f_handle (#37520) NetworkManager imports some systemd code, which we then build with `-Wcast-align=strict`. This results in this warning: ``` ../src/libnm-systemd-shared/src/basic/pidfd-util.c: In function 'pidfd_get_inode_id': ../src/libnm-systemd-shared/src/basic/pidfd-util.c:255:41: warning: cast increases required alignment of target type [-Wcast-align] 255 | *ret = *(uint64_t*) fh.file_handle.f_handle; | ^ ``` Since the address of `f_handle` should always be aligned at the word boundary (it is preceded by 2 int`s` in `file_handle`), this patch uses `CAST_ALIGN_PTR()` to avoid this warning. --- 27ffdb6d9e4956a75e03f6e7728e251ec56ba46d