RFR(10)(S): 8181503: Can't compile hotspot with c++11

Kim Barrett kim.barrett at oracle.com
Mon Jun 12 22:07:24 UTC 2017

> On Jun 12, 2017, at 10:29 AM, Gerard Ziemski <gerard.ziemski at oracle.com> wrote:
> hi all,
> Please review this small fix, which addresses 4 issues caught by c++11 compiler on a Mac:
> […]
> References:
> bug link at https://bugs.openjdk.java.net/browse/JDK-8181503
> webrev at http://cr.openjdk.java.net/~gziemski/8181503_rev1
> Tested with JPRT hotspot.

  38   static uint         _id;              // Solaris/Linux signals: 0 - SIGRTMAX

I think changing the type of _id from int to uint is really not so
simple. There's a bit of a type mess in this area, with some functions
expecting or using int and others uint. _id is set from an int value.
It is passed to os::exception_name, which takes an int argument. The
windows implementation of that function immediately casts that
argument to a uint, but the posix implementation actually wants an int
value. OTOH, there are other places that expect or treat _id as a
uint. So the proposed change is really just rearranging the deck
chairs in that mess, and is not really much of an improvement.
I *think* using uint consistently throughout for this value could be
made to work, but I haven't completely worked through it.

Also, in chasing through some of this, I noticed
os::Posix::is_valid_signal calls sigaddset with an uninitialized
sigset_t (neither sigemptyset nor sigfillset has been applied). The
documentation says the results are undefined if that initialization
hasn't been done.


Other changes look good.

More information about the hotspot-dev mailing list