Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8068883

Remove disabling of warning "C4355: 'this' : used in base member initializer list"

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Fix
    • Icon: P4 P4
    • None
    • None
    • hotspot
    • None
    • gc

      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.

            simonis Volker Simonis
            simonis Volker Simonis
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: