Please review this cleanup of deprecation warning suppression when building
for Windows.

This change consists of several parts.

(1) Remove the global deprecation warning suppression when building HotSpot
for Windows.

(2) Add macro definitions requesting suppression of selected sets of
deprecation warnings when building HotSpot for Windows.

(3) Remove unnecessary forwarding macros for various POSIX functions in
globalDefinitions_visCPP.hpp.  These were provided to avoid deprecation
warnings (that were previously also being suppressed by the global request).
They are now covered by the new macros provided by change (2) above.

An alternative to item (3) is to not define _CRT_NONSTDC_NO_DEPRECATE (in item
(2)) and either retain the forwarding macros or define os:: wrapper functions
for all of the affected functions.  We might eventually do the latter because
of other reasons for avoiding some of these functions, but the approach being
taken here is simpler.

For documentation of _CRT_NONSTDC_NO_DEPRECATE, see:
https://docs.microsoft.com/en-us/cpp/c-runtime-library/compatibility
https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996

Similarly for _CRT_SECURE_NO_WARNINGS.

Perhaps similarly for _WINSOCK_DEPRECATED_NO_WARNINGS (though I didn't find
any documentation for the latter).  But it might be better to not supress the
warnings and instead use the alternatives (JDK-8286781).

Testing:
mach5 tier1

-------------

Commit messages:
 - cleanup Windows deprecation warning suppression

Changes: https://git.openjdk.java.net/jdk/pull/8718/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8718&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8286262
  Stats: 21 lines in 4 files changed: 2 ins; 13 del; 6 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8718.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8718/head:pull/8718

PR: https://git.openjdk.java.net/jdk/pull/8718

Reply via email to