RFR: 8357193: [VS 2022 17.14] Warning C5287 in debugInit.c: enum type mismatch during build
Kim Barrett
kbarrett at openjdk.org
Mon May 19 05:39:51 UTC 2025
On Sun, 18 May 2025 23:44:13 GMT, Sergey Bylokhov <serb at openjdk.org> wrote:
> This patch suppresses compiler warning C5287 triggered in debugInit.c when building with Visual Studio 2022 version 17.14 (released a few days ago).
>
> I’m simply disabling the warning to unblock the broken build. This change is intended to be backported to update releases.
>
> A proper fix (e.g., explicit type cast) may be introduced later if necessary.
The various constants involved here are currently defined as enumerators of
(different) unscoped enums. Perhaps they shouldn't be enumerators at all.
https://github.com/openjdk/jdk/blame/9927ec0b91775db342b2bbc1937253325c367a19/doc/hotspot-style.md#L670-L674
Ordinarily I would say these ought to be typed constexprs, probably `jint`
since these seem to be actual Java values. But some of the code involved needs
to be both valid C and valid C++, which makes that noticeably harder.
I'm okay with the proposed warning suppression as a quick fix for a build
failure, but there should be a followup bug to fix it properly.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25293#issuecomment-2889678580
More information about the serviceability-dev
mailing list