Skip to content
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

GH-131296: fix clang-cl warning on Windows in socketmodule.c #131821

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

chris-eibl
Copy link
Contributor

@chris-eibl chris-eibl commented Mar 28, 2025

@@ -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;
Copy link
Contributor Author

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]

@@ -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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rest of the PR cares about deprecation warnings like

..\Modules\socketmodule.c(6070,9): warning : 'gethostbyname' is deprecated:
Use getaddrinfo() or GetAddrInfoW() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS
to disable deprecated API warnings [-Wdeprecated-declarations]

https://github.com/python/cpython/actions/runs/14044831663/job/39366560293?pr=131690#step:4:183

using the already existing infrastructure _Py_COMP_DIAG_PUSH et al. from pyport.h, because clang-cl unfortunately does not (yet) respect

# define SUPPRESS_DEPRECATED_CALL __pragma(warning(suppress: 4996))

@chris-eibl
Copy link
Contributor Author

I am pretty sure that failing of Ubuntu (free-threading) / build and test (ubuntu-24.04) (pull_request) is unrelated to the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants