RFR(XL): 8182299: Enable disabled clang warnings, build on OSX 10 + Xcode 8

Hohensee, Paul hohensee at amazon.com
Tue Jun 27 17:03:24 UTC 2017


Jesper has been kind enough to host the webrevs while I get my cr.openjdk.net account set up, and to be the sponsor.

This rfe a combination of enabling disabled clang warnings and getting jdk10 to build on OSX 10 and Xcode 8. At least one enabled warning (delete-non-virtual-dtor ) detected what seems to me a real potential bug, with the rest enforcing good code hygiene.

These changes are only in OpenJDK, so I’m looking for a volunteer to make the closed changes.



Here are the jdk notes:

        java_md_macosx.c splashscreen_sys.m:              Removed objc_registerThreadWithCollector() since it's obsolete and of questionable value in any case.
        NSApplicationAWT.m:                                               Use the correct NSEventMask rather than NSUInteger.
        jdhuff.c jdphuff.c:                                                       Shifting a negative signed value is undefined.

Here are the hotspot notes:

        Here are the lists of files affected by enabling a given warning:

        switch (lack of default clause):
        c1_LIRAssembler_x86.cpp c1_LIRGenerator_x86.cpp c1_LinearScan_x86.hpp jniFastGetField_x86_64.cpp assembler.cpp c1_Canonicalizer.cpp
                        c1_GraphBuilder.cpp c1_Instruction.cpp c1_LIR.cpp c1_LIRGenerator.cpp c1_LinearScan.cpp c1_ValueStack.hpp c1_ValueType.cpp
                        bcEscapeAnalyzer.cpp ciArray.cpp ciEnv.cpp ciInstance.cpp ciMethod.cpp ciMethodBlocks.cpp ciMethodData.cpp ciTypeFlow.cpp
                        compiledMethod.cpp dependencies.cpp nmethod.cpp compileTask.hpp heapRegionType.cpp abstractInterpreter.cpp bytecodes.cpp
                        invocationCounter.cpp linkResolver.cpp rewriter.cpp jvmciCompilerToVM.cpp jvmciEnv.cpp universe.cpp cpCache.cpp generateOopMap.cpp
                        method.cpp methodData.cpp compile.cpp connode.cpp gcm.cpp graphKit.cpp ifnode.cpp library_call.cpp memnode.cpp parse1.cpp
                        parse2.cpp phaseX.cpp superword.cpp type.cpp vectornode.cpp jvmtiClassFileReconstituter.cpp jvmtiEnter.xsl jvmtiEventController.cpp
                        jvmtiImpl.cpp jvmtiRedefineClasses.cpp methodComparator.cpp methodHandles.cpp advancedThresholdPolicy.cpp reflection.cpp
                        relocator.cpp sharedRuntime.cpp simpleThresholdPolicy.cpp writeableFlags.cpp globalDefinitions.hpp
        delete-non-virtual-dtor (may be real latent bugs due to possible failure to execute destructor(s) ):
                        decoder_aix.hpp decoder_machO.hpp classLoader.hpp g1RootClosures.hpp
                        jvmtiImpl.hpp perfData.hpp decoder.hpp decoder_elf.hpp
        dynamic-class-memaccess: method.cpp
        empty-body: objectMonitor.cpp mallocSiteTable.cpp
        format (debug output will be affected by incorrect code changes to these):
                        macroAssembler_x86.cpp os_bsd.cpp os_bsd_x86.cpp ciMethodData.cpp javaClasses.cpp debugInfo.cpp logFileOutput.cpp
                        constantPool.cpp jvmtiEnter.xsl jvmtiRedefineClasses.cpp safepoint.cpp thread.cpp
                        nativeInst_x86.hpp archDesc.cpp output_c.cpp output_h.cpp c1_GraphBuilder.cpp c1_LIRGenerator.cpp c1_LinearScan.cpp
                        bcEscapeAnalyzer.cpp ciMethod.cpp stackMapTableFormat.hpp compressedStream.cpp dependencies.cpp heapRegion.cpp
                        ptrQueue.cpp psPromotionManager.cpp jvmciCompilerToVM.cpp cfgnode.cpp chaitin.cpp compile.cpp compile.hpp
                        escape.cpp graphKit.cpp lcm.cpp loopTransform.cpp loopnode.cpp loopopts.cpp macro.cpp memnode.cpp
                        output.cpp parse1.cpp parseHelper.cpp reg_split.cpp superword.cpp superword.hpp jniCheck.cpp jvmtiEventController.cpp
                        arguments.cpp javaCalls.cpp sharedRuntime.cpp
        parentheses: adlparse.cpp
        parentheses-equality: output_c.cpp javaAssertions.cpp gcm.cpp

        File-specific details:

        GensrcAdlc.gmk:        Left tautological-compare in place to allow null 'this' pointer checks in methods intended to be called from a debugger.
        CompileGTest.gmk:   Please ignore this one, since it requires changes to Google’s gtest source, which I doubt we want to do.
        CompileJvm.gmk:       Left tautological-compare in place to allow null 'this' pointer checks in methods intended to be called from a debugger.

        MacosxDebuggerLocal.m:       PT_ATTACH has been replaced by PT_ATTACHEXC
        ciMethodData.cpp:                   " 0x%" FORMAT64_MODIFIER "x"  reduces to "0x%llx", whereas  " " INTPTRNZ_FORMAT reduces to "0x%lx"
        generateOopMap.cpp:             Refactored duplicate code in print_current_state()
        binaryTreeDictionary.cpp/hpp, hashtable.cpp/hpp:
                                                                These provoke “instantiation of variable <static class variable> required here, but no definition is available”.
        globalDefinitions_gcc.hpp:      Define FORMAT64_MODIFIER properly for Apple, needed by os.cpp.
        globalDefinitions.hpp:               Add INTPTRNZ_FORMAT, needed by ciMethodData.cpp.

More information about the hotspot-dev mailing list