Details
Description
Originally this was aimed at just Windows: Avoid using deprecated names from winsock2.h
> We currently suppress warnings for uses of some functions in winsock2.h (beforeJDK-8286262 by globally suppressing deprecation warnings, after by defining
> _WINSOCK_DEPRECATED_NO_WARNINGS). It might be better to update our code to not use the deprecated names and remove the warning suppression.
but it turns out that gethostbyname is also marked as obsolete on Linux and is not part of Posix anyway! So we can replace its use by getaddrinfo which is supported on Windows and Posix.
inet_addr is also deprecated on Windows and considered superceded in Posix by inet_pton.
> We currently suppress warnings for uses of some functions in winsock2.h (before
> _WINSOCK_DEPRECATED_NO_WARNINGS). It might be better to update our code to not use the deprecated names and remove the warning suppression.
but it turns out that gethostbyname is also marked as obsolete on Linux and is not part of Posix anyway! So we can replace its use by getaddrinfo which is supported on Windows and Posix.
inet_addr is also deprecated on Windows and considered superceded in Posix by inet_pton.
Attachments
Issue Links
- relates to
-
JDK-8286262 Windows: Cleanup deprecation warning suppression
- Resolved