The branch, master has been updated via f5c3e25 Fix -Wcast-qual warnings from cdc071a Bump version to 1.3.4
https://git.samba.org/?p=socket_wrapper.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit f5c3e25c9910d305a26f267fcfa0bfe8d97834ec Author: Alex Richardson <alexander.richard...@cl.cam.ac.uk> Date: Fri Oct 1 10:00:32 2021 +0100 Fix -Wcast-qual warnings Without this change I get the following -Werror build failure when building samba on macOS: ``` ../../third_party/socket_wrapper/socket_wrapper.c:5420:15: error: cast from 'const struct cmsghdr *' to 'unsigned char *' drops const qualifier [-Werror,-Wcast-qual] __fds_in.p = CMSG_DATA(cmsg); ^ /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/sys/socket.h:631:51: note: expanded from macro 'CMSG_DATA' #define CMSG_DATA(cmsg) ((unsigned char *)(cmsg) + \ ^ ``` Signed-off-by: Alex Richardson <alexander.richard...@cl.cam.ac.uk> Reviewed-by: Stefan Metzmacher <me...@samba.org> Reviewed-by: Andreas Schneider <a...@samba.org> ----------------------------------------------------------------------- Summary of changes: CompilerChecks.cmake | 2 +- src/socket_wrapper.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) Changeset truncated at 500 lines: diff --git a/CompilerChecks.cmake b/CompilerChecks.cmake index 195d619..8d18fbf 100644 --- a/CompilerChecks.cmake +++ b/CompilerChecks.cmake @@ -22,7 +22,7 @@ if (UNIX) add_c_compiler_flag("-Wshadow" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wmissing-prototypes" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wcast-align" SUPPORTED_COMPILER_FLAGS) - #add_c_compiler_flag("-Wcast-qual" SUPPORTED_COMPILER_FLAGS) + add_c_compiler_flag("-Wcast-qual" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Werror=address" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Wstrict-prototypes" SUPPORTED_COMPILER_FLAGS) add_c_compiler_flag("-Werror=strict-prototypes" SUPPORTED_COMPILER_FLAGS) diff --git a/src/socket_wrapper.c b/src/socket_wrapper.c index 5804e93..ec8321f 100644 --- a/src/socket_wrapper.c +++ b/src/socket_wrapper.c @@ -5325,7 +5325,7 @@ union __swrap_cmsghdr { struct cmsghdr *cmsg; }; -static int swrap_sendmsg_unix_scm_rights(const struct cmsghdr *cmsg, +static int swrap_sendmsg_unix_scm_rights(struct cmsghdr *cmsg, uint8_t **cm_data, size_t *cm_data_space, int *scm_rights_pipe_fd) @@ -5557,7 +5557,7 @@ static int swrap_sendmsg_unix_scm_rights(const struct cmsghdr *cmsg, return 0; } -static int swrap_sendmsg_unix_sol_socket(const struct cmsghdr *cmsg, +static int swrap_sendmsg_unix_sol_socket(struct cmsghdr *cmsg, uint8_t **cm_data, size_t *cm_data_space, int *scm_rights_pipe_fd) @@ -5581,7 +5581,7 @@ static int swrap_sendmsg_unix_sol_socket(const struct cmsghdr *cmsg, return rc; } -static int swrap_recvmsg_unix_scm_rights(const struct cmsghdr *cmsg, +static int swrap_recvmsg_unix_scm_rights(struct cmsghdr *cmsg, uint8_t **cm_data, size_t *cm_data_space) { @@ -5860,7 +5860,7 @@ static int swrap_recvmsg_unix_scm_rights(const struct cmsghdr *cmsg, return 0; } -static int swrap_recvmsg_unix_sol_socket(const struct cmsghdr *cmsg, +static int swrap_recvmsg_unix_sol_socket(struct cmsghdr *cmsg, uint8_t **cm_data, size_t *cm_data_space) { -- Socket Wrapper Repository