RFR: 8286262: Windows: Cleanup deprecation warning suppression

Kim Barrett kbarrett at openjdk.java.net
Mon May 23 22:50:47 UTC 2022


On Tue, 17 May 2022 06:30:03 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> 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
>
> Sorry Kim I'm having trouble seeing what change corresponds to (1) ??
> 
> Also the PR talks only about hotspot, but you're changing the JDK flags as well. ??

Thanks @dholmes-ora and @magicus for reviews.

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

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



More information about the build-dev mailing list