[8u] RFR: 8196882: VS2017 Hotspot Defined vsnprintf Function Causes C2084 Already Defined Compilation Error
kevin.walls at oracle.com
Fri Jul 13 19:12:22 UTC 2018
I'd like to request a review of a backport from 11 to 8u:
8196882: VS2017 Hotspot Defined vsnprintf Function Causes C2084 Already
Defined Compilation Error
11 review thread:
8u webrev: http://cr.openjdk.java.net/~kevinw/8196882/webrev.00/
From VS2015, vsnprintf is provided, and is C99 conforming. This is
conflicts with the hotspot-provided definition. 8196882 introduces
so we can choose what we call in there.
We don't necessarily want to change behaviour in jdk8u, so we call
on Windows to get the old behaviour.
I didn't plan to move everything to a C99 behaviour here for jdk8u as we
did in jdk11.
We just want to solve the symbol clash, so outputStream::do_vsnprintf()
not need to change as it does in 11.
In jvm.cpp, the change in jdk11 changes jio_vsnprintf behaviour, but we
normally choose to change the behaviour at this point in 8u.
(But ensuring the buffer is null-terminated looks like a positive change.)
The original has GTests, here in 8u it's a debug-mode test at runtime.
I have edited some of the
asserts in check_snprintf_result() as not changing jio_vsnprintf.
I've been building and testing with VS2017 and the current default
plus the other platforms.
More information about the hotspot-dev