RFR: 8307163: JLONG_FORMAT_SPECIFIER should be updated on Windows

Julian Waters jwaters at openjdk.org
Wed May 3 11:18:18 UTC 2023


On Wed, 3 May 2023 07:27:23 GMT, David Holmes <dholmes at openjdk.org> wrote:

> > Is the globalDefinitions declaration what you're referring to?
> 
> Yes. I'm not clear on the background to all these PRI* format modifiers - all seems rather convoluted.

Ah, I see. PRId64 (the 64 bit signed format specifier) used to be %I64d on Windows for a while, but Microsoft has long since replaced them with the proper %lld format specifier a while ago, and strongly encourages C and C++ code on Windows to do the same: https://learn.microsoft.com/en-us/cpp/c-runtime-library/format-specification-syntax-printf-and-wprintf-functions?view=msvc-170

It's not a critical issue, but it still is better to replace the outdated formatting in native and HotSpot code which we define ourselves (as opposed to directly using PRId64) to use what Microsoft themselves have changed the specifier to

I've also just noticed that we should probably also change jlong from __int64 to long long in Windows specific JNI as well to go along with this change

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

PR Comment: https://git.openjdk.org/jdk/pull/13740#issuecomment-1532852631


More information about the hotspot-dev mailing list