Detected by 32-bit Windows compiler:
[2024-05-13T03:57:12,215Z] c:\sb\prod\1715572015\workspace\open\src\hotspot\share\utilities\istream.cpp(250): error C2220: the following warning is treated as an error
[2024-05-13T03:57:12,215Z] c:\sb\prod\1715572015\workspace\open\src\hotspot\share\utilities\istream.cpp(250): warning C4267: '=': conversion from 'size_t' to 'char', possible loss of data
The code line is:
_line_ending = (int)(_next - end);
where _next and end are size_t, and:
char _line_ending; // one of {0,1,2} for "", "\n", "\r\n"
There is clearly a loss of precision here: size_t -> int -> char, but the cast to int makes the error message unexpected.
Simplest fix is to just make _line_ending an int.
[2024-05-13T03:57:12,215Z] c:\sb\prod\1715572015\workspace\open\src\hotspot\share\utilities\istream.cpp(250): error C2220: the following warning is treated as an error
[2024-05-13T03:57:12,215Z] c:\sb\prod\1715572015\workspace\open\src\hotspot\share\utilities\istream.cpp(250): warning C4267: '=': conversion from 'size_t' to 'char', possible loss of data
The code line is:
_line_ending = (int)(_next - end);
where _next and end are size_t, and:
char _line_ending; // one of {0,1,2} for "", "\n", "\r\n"
There is clearly a loss of precision here: size_t -> int -> char, but the cast to int makes the error message unexpected.
Simplest fix is to just make _line_ending an int.
- relates to
-
JDK-8330532 Improve line-oriented text parsing in HotSpot
- Resolved
- links to
-
Commit(master) openjdk/jdk/1348ece6
-
Review(master) openjdk/jdk/20427