summaryrefslogtreecommitdiff
path: root/dbus/dbus-sysdeps-unix.c
diff options
context:
space:
mode:
authorAlex Richardson <arichardson.kde@gmail.com>2022-05-15 11:14:02 +0100
committerAlexander Richardson <alexander.richardson@cl.cam.ac.uk>2022-05-17 11:21:33 +0000
commiteb70deaaab9dba370f3d56ee1fa560a322cca464 (patch)
tree191e685a4fc0d71a16d733f4c96b36679c7151c7 /dbus/dbus-sysdeps-unix.c
parentd68c843b27375fad6778ea63a2700877924b4245 (diff)
downloaddbus-eb70deaaab9dba370f3d56ee1fa560a322cca464.tar.gz
dbus-sysdeps-unix.c: Silence -Wcast-align when using CMSG_DATA
This triggers when building on FreeBSD with clang, but since we know that the CMSG_DATA() will be aligned we can silence the warning using a cast.
Diffstat (limited to 'dbus/dbus-sysdeps-unix.c')
-rw-r--r--dbus/dbus-sysdeps-unix.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dbus/dbus-sysdeps-unix.c b/dbus/dbus-sysdeps-unix.c
index 9a35d076..4ee23287 100644
--- a/dbus/dbus-sysdeps-unix.c
+++ b/dbus/dbus-sysdeps-unix.c
@@ -461,7 +461,7 @@ _dbus_read_socket_with_unix_fds (DBusSocket fd,
if (cm->cmsg_level == SOL_SOCKET && cm->cmsg_type == SCM_RIGHTS)
{
size_t i;
- int *payload = (int *) CMSG_DATA (cm);
+ int *payload = (int *) (void *) CMSG_DATA (cm);
size_t payload_len_bytes = (cm->cmsg_len - CMSG_LEN (0));
size_t payload_len_fds;
size_t fds_to_use;
@@ -2372,7 +2372,7 @@ _dbus_read_credentials_socket (DBusSocket client_fd,
cmsgp->cmsg_level == SOL_SOCKET &&
cmsgp->cmsg_len >= CMSG_LEN (sizeof (struct cmsgcred)))
{
- cred = (struct cmsgcred *) CMSG_DATA (cmsgp);
+ cred = (struct cmsgcred *) (void *) CMSG_DATA (cmsgp);
pid_read = cred->cmcred_pid;
uid_read = cred->cmcred_euid;
break;