RFR: 8312190: Fix c++11-narrowing warnings in hotspot code
Daniel Jeliński
djelinski at openjdk.org
Tue Jul 18 07:07:14 UTC 2023
On Tue, 18 Jul 2023 05:11:52 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> This patch fixes compilation warnings produced by Clang when compiling on Windows.
>>
>> Clang emulates MSVC behavior and uses `int` for enumeration types that do not explicitly specify the underlying type. This patch sets an explicit underlying type for 3 enumerations to fix the warnings.
>>
>> See Microsoft's documentation of [Zc:enumTypes](https://learn.microsoft.com/en-us/cpp/build/reference/zc-enumtypes?view=msvc-170) for more information.
>
> src/hotspot/share/utilities/debug.hpp line 248:
>
>> 246:
>> 247: // types of VM error - originally in vmError.hpp
>> 248: enum VMErrorType : unsigned int {
>
> Why 'unsigned int' when the other changes are `uint`?
`uint` is not available in this header file, and I didn't want to add includes.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/14907#discussion_r1266324719
More information about the hotspot-dev
mailing list