RFR (S): 8143215: gcc 4.1.2: fix three issues breaking the build.
Kim Barrett
kim.barrett at oracle.com
Wed Nov 18 17:16:53 UTC 2015
On Nov 18, 2015, at 6:07 AM, Lindenmaier, Goetz <goetz.lindenmaier at sap.com> wrote:
>
> This change fixes some minor issues breaking the build with gcc 4.1.2.
> In g1CollectorPolicy.cpp casts are missing.
> concurrentG1RefineThread.cpp needs a newline at the end of the file.
>
> Please review this change. I please need a sponsor.
> http://cr.openjdk.java.net/~goetz/webrevs/8143215-gcc412/webrev.00/
> https://bugs.openjdk.java.net/browse/JDK-8143215
>
I really dislike casts, so I'm predisposed against changes of the kind
being proposed here. Especially when they are targeted specifically
at a particular version of a particular compiler.
The code appears to be fine as-is, so what is the purpose of these
casts? I will hazard a guess that they are to prevent warnings. So
what warnings? And why are there not warnings from later versions of
the same compiler?
All of the new casts are to make explicit what are currently implicit
double to size_t conversions. Looking through gcc's warning options,
this suggests something to do with -Wconversion. And that option is
only added when the gcc version is less than 4.3, due to a significant
change to the semantics of that option in that version.
Assuming my guesses are correct, rather than uglifying the source
code, I suggest a better direction would be to look at the warning
option usage and make some change there.
More information about the hotspot-gc-dev
mailing list