JDK-8219583 : Windows build failure after JDK-8214777 (Avoid some GCC 8.X strncpy() errors in HotSpot)
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 13
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-02-22
  • Updated: 2024-03-15
  • Resolved: 2019-02-25
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 11 JDK 13
11.0.20-oracleFixed 13 b10Fixed
Related Reports
Relates :  
Relates :  
Description
Windows, x86_64, fastdebug:

* For target hotspot_variant-server_libjvm_objs_classFileParser.obj:
classFileParser.cpp
c:/cygwin64/home/windows/worker/jdkX-windows/build/src/hotspot/share/classfile/classFileParser.cpp(5750) : error C3861: 'snprintf': identifier not found
   ... (rest of output omitted)

The call to snprintf apparently got introduced with JDK-8214777. #include <stdio.h> is probably missing in classFileParser.cpp? This probably only affects the builds with --disable-precompiled-headers, which might explain why it was not caught before integration.

runtime/os.hpp has the definition like this:
  // Provide C99 compliant versions of these functions, since some versions
  // of some platforms don't.
  static int vsnprintf(char* buf, size_t len, const char* fmt, va_list args) ATTRIBUTE_PRINTF(3, 0);
  static int snprintf(char* buf, size_t len, const char* fmt, ...) ATTRIBUTE_PRINTF(3, 4);

The rest of the code uses jio_snprintf, though.
Comments
Fix Request I would like to propose a backport, to improve compatibility with older compilers, and increase ease of backporting future changes. This backport requires 821477 [1] to be committed prior, and will not merge otherwise. The original patch is unchanged for jdk11u. [1] https://bugs.openjdk.java.net/browse/JDK-8214777
19-08-2019

URL: http://hg.openjdk.java.net/jdk/jdk/rev/45a23c64d0f6 User: shade Date: 2019-02-23 09:56:07 +0000
25-02-2019

RFR: https://mail.openjdk.java.net/pipermail/hotspot-runtime-dev/2019-February/032801.html
22-02-2019