RFR: JDK-8211073 Remove -Wno-extra from Hotspot

Kim Barrett kim.barrett at oracle.com
Fri Sep 28 21:22:48 UTC 2018

> On Sep 24, 2018, at 4:31 PM, Magnus Ihse Bursie <magnus.ihse.bursie at oracle.com> wrote:
> The second warning about the copy constructor is, for what I can tell, a highly valid warning and the code it warned on was indeed broken. As far as I can tell, in a derived copy constructor you should always explicitly initialize the base class.

I agree the copy constructor warnings are correct and indicate potentially serious bugs.
These copy constructor changes look correct to me.  

The code that is being missed because of this bug is debug-only usage verification.  I think
bad things might happen if we C-heap allocated a ResourceObj and then copied that object.
Maybe we fortuitously don’t ever do that?

It’s unfortunate that the only way to get these warnings from gcc seems to be via -Wextra.

> Bug: https://bugs.openjdk.java.net/browse/JDK-8211073
> WebRev: http://cr.openjdk.java.net/~ihse/JDK-8211073-remove-Wno-extra-from-hotspot/webrev.01
> /Magnus
> [1] https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html

More information about the hotspot-dev mailing list