RFR: 8286371: Avoid use of deprecated str[n]icmp

Kim Barrett kbarrett at openjdk.java.net
Mon May 9 05:27:11 UTC 2022


Please review this trivial change to use _str[n]icmp instead of (deprecated)
str[n]icmp in the only places the latter are used in HotSpot, in
Windows-specific code.  This change is in preparation for removing the global
disable of deprecation warnings for HotSpot Windows builds.

An alternative would be to use str[n]casecmp, which are defined in
globalDefinitions_visCPP.hpp for compatibilty in shared code. But since the
uses of the functions being changed are in Windows-specific code I think the
non-deprecated Windows-specific functions are more appropriate.

There are some other uses of the deprecated functions in the JDK. I didn't
change them. Those other places have different approaches to dealing with the
source compatibility and deprecation than does HotSpot, suppressing the
warning for this and various other functions using _CRT_NONSTDC_NO_DEPRECATE.

Note that the deprecation message for these functions is the same one used for
deprecating various POSIX functions, and the deprecation is under the control
of the same macro, even though these aren't actually from POSIX.

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

Commit messages:
 - use _str[n]icmp

Changes: https://git.openjdk.java.net/jdk/pull/8590/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=8590&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8286371
  Stats: 3 lines in 1 file changed: 0 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/8590.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/8590/head:pull/8590

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


More information about the hotspot-runtime-dev mailing list