-
-
Notifications
You must be signed in to change notification settings - Fork 32k
GH-131296: fix clang-cl warning on Windows in socketmodule.c #131821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -671,12 +671,6 @@ select_error(void) | |
# define SOCK_INPROGRESS_ERR EINPROGRESS | ||
#endif | ||
|
||
#ifdef _MSC_VER | ||
# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996)) | ||
#else | ||
# define SUPPRESS_DEPRECATED_CALL | ||
#endif | ||
|
||
/* Convenience function to raise an error according to errno | ||
and return a NULL pointer from a function. */ | ||
|
||
|
@@ -3237,7 +3231,7 @@ sock_setsockopt(PyObject *self, PyObject *args) | |
&level, &optname, &flag)) { | ||
#ifdef MS_WINDOWS | ||
if (optname == SIO_TCP_SET_ACK_FREQUENCY) { | ||
int dummy; | ||
DWORD dummy; | ||
res = WSAIoctl(get_sock_fd(s), SIO_TCP_SET_ACK_FREQUENCY, &flag, | ||
sizeof(flag), NULL, 0, &dummy, NULL, NULL); | ||
if (res >= 0) { | ||
|
@@ -6066,8 +6060,10 @@ socket_gethostbyname_ex(PyObject *self, PyObject *args) | |
#ifdef USE_GETHOSTBYNAME_LOCK | ||
PyThread_acquire_lock(netdb_lock, 1); | ||
#endif | ||
SUPPRESS_DEPRECATED_CALL | ||
_Py_COMP_DIAG_PUSH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The rest of the PR cares about deprecation warnings like
https://github.com/python/cpython/actions/runs/14044831663/job/39366560293?pr=131690#step:4:183 using the already existing infrastructure # define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996)) |
||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS | ||
h = gethostbyname(name); | ||
_Py_COMP_DIAG_POP | ||
#endif /* HAVE_GETHOSTBYNAME_R */ | ||
Py_END_ALLOW_THREADS | ||
/* Some C libraries would require addr.__ss_family instead of | ||
|
@@ -6171,8 +6167,10 @@ socket_gethostbyaddr(PyObject *self, PyObject *args) | |
#ifdef USE_GETHOSTBYNAME_LOCK | ||
PyThread_acquire_lock(netdb_lock, 1); | ||
#endif | ||
SUPPRESS_DEPRECATED_CALL | ||
_Py_COMP_DIAG_PUSH | ||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS | ||
h = gethostbyaddr(ap, al, af); | ||
_Py_COMP_DIAG_POP | ||
#endif /* HAVE_GETHOSTBYNAME_R */ | ||
Py_END_ALLOW_THREADS | ||
ret = gethost_common(state, h, SAS2SA(&addr), sizeof(addr), af); | ||
|
@@ -6649,8 +6647,10 @@ _socket_socket_inet_aton_impl(PySocketSockObject *self, const char *ip_addr) | |
packed_addr = INADDR_BROADCAST; | ||
} else { | ||
|
||
SUPPRESS_DEPRECATED_CALL | ||
_Py_COMP_DIAG_PUSH | ||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS | ||
packed_addr = inet_addr(ip_addr); | ||
_Py_COMP_DIAG_POP | ||
|
||
if (packed_addr == INADDR_NONE) { /* invalid address */ | ||
PyErr_SetString(PyExc_OSError, | ||
|
@@ -6693,8 +6693,10 @@ _socket_socket_inet_ntoa_impl(PySocketSockObject *self, Py_buffer *packed_ip) | |
memcpy(&packed_addr, packed_ip->buf, packed_ip->len); | ||
PyBuffer_Release(packed_ip); | ||
|
||
SUPPRESS_DEPRECATED_CALL | ||
_Py_COMP_DIAG_PUSH | ||
_Py_COMP_DIAG_IGNORE_DEPR_DECLS | ||
return PyUnicode_FromString(inet_ntoa(packed_addr)); | ||
_Py_COMP_DIAG_POP | ||
} | ||
#endif // HAVE_INET_NTOA | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix warning : incompatible pointer types passing 'int *' to parameter of type 'LPDWORD' (aka 'unsigned long *') [-Wincompatible-pointer-types]