RFR: 8330989: unify os::create_binary_file across platforms [v2]

Matthias Baesken mbaesken at openjdk.org
Fri Apr 26 07:39:32 UTC 2024


On Fri, 26 Apr 2024 06:48:05 GMT, David Holmes <dholmes at openjdk.org> wrote:

> > Hi David, no compile or test errors have been observed in GHA or in our internal testing. So should we keep what we have? Or go for the '_' prefixed flags and _open on Windows ?
> 
> Okay. Based on this:
> 
> https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/open?view=msvc-170 https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=msvc-170#posix-function-names
> 
> I expected to see compiler deprecation warningsm as AFAICS we don't disable them. ??
> 
> If this works then I guess it is okay.

Hi David, this is indeed a little strange.   The MS document you mentioned says 

> The Microsoft-implemented POSIX function name open is a deprecated alias for the [_open](https://learn.microsoft.com/en-us/cpp/c-runtime-library/reference/open-wopen?view=msvc-170) function. By default, it generates [Compiler warning (level 3) C4996](https://learn.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-level-3-c4996?view=msvc-170).

We disable the mentioned warning 4996 for quite a few compilation units (grep for 4996 in make/modules), but not for all.
I do not see it disabled for os.cpp. But still no compilation errors in GHA or our builds/tests.  Maybe for some strange reason 'open'  is bad but '::open' is okay for MSVC (it is used anyway in os_windows.cpp see `os::dll_load`)?

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

PR Comment: https://git.openjdk.org/jdk/pull/18918#issuecomment-2078807614


More information about the hotspot-runtime-dev mailing list