diff -r cea42629ddf5 Modules/socketmodule.c --- a/Modules/socketmodule.c Fri Dec 13 11:43:10 2013 -0500 +++ b/Modules/socketmodule.c Fri Dec 13 11:53:27 2013 -0500 @@ -1917,9 +1917,16 @@ static const size_t cmsg_len_end = (offsetof(struct cmsghdr, cmsg_len) + sizeof(cmsgh->cmsg_len)); - /* Note that POSIX allows msg_controllen to be of signed type. */ - if (cmsgh == NULL || msg->msg_control == NULL || msg->msg_controllen < 0) + if (cmsgh == NULL || msg->msg_control == NULL) return 0; + /* Note that POSIX allows msg_controllen to be of a signed type. This is a + problem under OS X as it's unsigned there. Turn off the compiler warning + in that instance using pragmas. */ + #pragma clang diagnostic push + #pragma clang diagnostic ignored "-Wtautological-compare" + if (msg->msg_controllen < 0) + return 0; + #pragma clang diagnostic pop if (space < cmsg_len_end) space = cmsg_len_end; cmsg_offset = (char *)cmsgh - (char *)msg->msg_control;