⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 294895 in webkit


Ignore:
Timestamp:
May 26, 2022, 1:45:57 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Build with -Wno-stringop-overflow when using GCC
​https://bugs.webkit.org/show_bug.cgi?id=240596

Patch by Michael Catanzaro <​mcatanzaro@redhat.com> on 2022-05-26
Reviewed by Adrian Perez de Castro.

Also, rearrange and simplify the warning flag code.

And remove suppression of -Wno-attributes, since GCC 8 is everywhere nowadays.

  • Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp:

(JSC::FTL::DFG::LowerDFGToB3::compileCompareStrictEq):

  • Source/JavaScriptCore/ftl/FTLOSRExit.cpp:

(JSC::FTL::OSRExitDescriptor::prepareOSRExitHandle):

  • Source/WebCore/loader/DocumentWriter.cpp:

(WebCore::DocumentWriter::end):

  • Source/cmake/WebKitCompilerFlags.cmake:

Canonical link: ​https://commits.webkit.org/251018@main

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ftl/FTLLowerDFGToB3.cpp

    r294873 r294895  
    2075220752            if (exitValue.hasIndexInStackmapLocations())
    2075320753                exitValue.adjustStackmapLocationsIndexByOffset(offsetOfExitArgumentsInStackmapLocations);
    20754 IGNORE_GCC_WARNINGS_BEGIN("stringop-overflow")
    2075520754            exitDescriptor->m_values[i] = exitValue;
    20756 IGNORE_GCC_WARNINGS_END
    2075720755        }
    2075820756       
  • trunk/Source/JavaScriptCore/ftl/FTLOSRExit.cpp

    r290681 r294895  
    8484{
    8585    FixedVector<B3::ValueRep> valueReps(params.size() - offset);
    86 IGNORE_GCC_WARNINGS_BEGIN("stringop-overflow")
    8786    for (unsigned i = offset, indexInValueReps = 0; i < params.size(); ++i, ++indexInValueReps)
    8887        valueReps[indexInValueReps] = params[i];
    89 IGNORE_GCC_WARNINGS_END
    9088    unsigned index = state.jitCode->m_osrExit.size();
    9189    state.jitCode->m_osrExit.append(OSRExit(this, exitKind, nodeOrigin.forExit, nodeOrigin.semantic, nodeOrigin.wasHoisted, dfgNodeIndex, WTFMove(valueReps)));
  • trunk/Source/WebCore/loader/DocumentWriter.cpp

    r294164 r294895  
    297297    // The frame's last ref may be removed and it can be deleted by checkCompleted(),
    298298    // so we'll add a protective refcount
    299 IGNORE_GCC_WARNINGS_BEGIN("stringop-overflow")
    300299    Ref<Frame> protect(*m_frame);
    301 IGNORE_GCC_WARNINGS_END
    302300
    303301    if (!m_parser)
  • trunk/Source/cmake/WebKitCompilerFlags.cmake

    r293608 r294895  
    132132    WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-noexcept-type)
    133133
    134     # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80947
    135     if (${CMAKE_CXX_COMPILER_VERSION} VERSION_LESS "8.0" AND NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
    136         WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-attributes)
    137     endif ()
    138 
    139     # Since GCC 11, these warnings produce too many false positives to be useful. We'll rely on
    140     # developers who build with Clang to notice these warnings.
    141     if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "11.0")
     134    # These GCC warnings produce too many false positives to be useful. We'll
     135    # rely on developers who build with Clang to notice these warnings.
     136    if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
     137        # https://bugs.webkit.org/show_bug.cgi?id=167643#c13
     138        WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-expansion-to-defined)
     139
     140        # https://bugs.webkit.org/show_bug.cgi?id=228601
    142141        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-array-bounds)
    143142        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-nonnull)
    144     endif ()
    145 
    146     # This triggers warnings in wtf/Packed.h, a header that is included in many places. It does not
    147     # respect ignore warning pragmas and we cannot easily suppress it for all affected files.
    148     # https://bugs.webkit.org/show_bug.cgi?id=226557
    149     if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "11.0")
     143
     144        # https://bugs.webkit.org/show_bug.cgi?id=240596
     145        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-stringop-overflow)
     146
     147        # This triggers warnings in wtf/Packed.h, a header that is included in many places. It does not
     148        # respect ignore warning pragmas and we cannot easily suppress it for all affected files.
     149        # https://bugs.webkit.org/show_bug.cgi?id=226557
    150150        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-stringop-overread)
    151     endif ()
    152 
    153     # -Wodr trips over our bindings integrity feature when LTO is enabled.
    154     # https://bugs.webkit.org/show_bug.cgi?id=229867
    155     if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
     151
     152        # -Wodr trips over our bindings integrity feature when LTO is enabled.
     153        # https://bugs.webkit.org/show_bug.cgi?id=229867
    156154        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-odr)
    157     endif ()
    158 
    159     # -Wexpansion-to-defined produces false positives with GCC but not Clang
    160     # https://bugs.webkit.org/show_bug.cgi?id=167643#c13
    161     if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
    162         WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-expansion-to-defined)
    163155    endif ()
    164156
Note: See TracChangeset for help on using the changeset viewer.