Fix some warnings produced by different compilers. (GH-5593) (GH-5600)
(cherry picked from commit bfe4fd5f2e96e72eecb5b8a0c7df0ac1689f3b7e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
diff --git a/Modules/socketmodule.c b/Modules/socketmodule.c
index 474c1c9..7fc3d87 100644
--- a/Modules/socketmodule.c
+++ b/Modules/socketmodule.c
@@ -4867,7 +4867,9 @@
if (type == -1) {
int tmp;
socklen_t slen = sizeof(tmp);
- if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &tmp, &slen) == 0) {
+ if (getsockopt(fd, SOL_SOCKET, SO_TYPE,
+ (void *)&tmp, &slen) == 0)
+ {
type = tmp;
} else {
#ifdef MS_WINDOWS
@@ -4885,7 +4887,9 @@
if (proto == -1) {
int tmp;
socklen_t slen = sizeof(tmp);
- if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL, &tmp, &slen) == 0) {
+ if (getsockopt(fd, SOL_SOCKET, SO_PROTOCOL,
+ (void *)&tmp, &slen) == 0)
+ {
proto = tmp;
} else {
#ifdef MS_WINDOWS