JDK-8068883 : Remove disabling of warning "C4355: 'this' : used in base member initializer list"
  • Type: Enhancement
  • Component: hotspot
  • Sub-Component: gc
  • Priority: P4
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2015-01-13
  • Updated: 2017-01-18
  • Resolved: 2015-02-16
Related Reports
Relates :  
Relates :  
Description
There are several places in the GC coding which disable the warning Visual Studio warning "C4355: 'this' : used in base member initializer list":

src/share/vm/gc_implementation/g1/concurrentMark.cpp:#pragma warning( disable:4355 )
src/share/vm/gc_implementation/g1/dirtyCardQueue.cpp:#pragma warning( disable:4355 )
src/share/vm/gc_implementation/g1/g1CollectedHeap.cpp:#pragma warning( disable:4355 )
src/share/vm/gc_implementation/g1/satbQueue.cpp:#pragma warning( disable:4355 )
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp:#pragma warning( disable:4355 )
src/share/vm/gc_implementation/parNew/parNewGeneration.cpp:#pragma warning( disable:4355 )

However this warning is reasonable and we've recently found a bug which was caused by the usage of the incompletely initialized this pointer in the initializer list (see 8068739).

It would be therefore better to remove the pragmas which disable the warning and refactor the code such  that it doesn't use the 'this' pointer in the initializer list anymore.
Comments
The outcome of the discussion was that the proposed change is not necessary. One part of the initial patch which just removed another, unrelated pragma was split up into another bug (https://bugs.openjdk.java.net/browse/JDK-8073188) and will be fixed under that bug id.
16-02-2015

The outcome of the discussion was that the proposed change is not necessary so I'll close this issue as "won't fix". One part of the initial patch which just removed another, unrelated pragma was split up into another bug (https://bugs.openjdk.java.net/browse/JDK-8073188) and will be fixed under that bug id.
16-02-2015

It is not clear if we really want to fix this issue and if the proposed fix (http://cr.openjdk.java.net/~simonis/webrevs/2015/8068883/) is really an improvement. There's currently a discussion going on the hotspot-gc-dev mailing list. See: http://mail.openjdk.java.net/pipermail/hotspot-gc-dev/2015-January/thread.html#11764
16-01-2015