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

Changeset 280689 in webkit


Ignore:
Timestamp:
Aug 5, 2021, 8:27:03 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
https://bugs.webkit.org/show_bug.cgi?id=228601

Patch by Michael Catanzaro <Michael Catanzaro> on 2021-08-05
Reviewed by Carlos Garcia Campos.

.:

Prior to GCC 11, these were good warnings that could catch serious errors. But GCC 11 has
just become too sensitive and it's flagging what appear to be harmless cases, and not
providing enough feedback to know why. This has resulted in me littering our code with
pragmas to suppress GCC's false positives, and I think it's reached the point where it's
nicer to just turn off the warnings until such time that GCC gets this under control, and
rely on Clang instead in the meantime.

The GCC developers have indicated that these warnings will *always* produce false positives
in some circumstances, but with GCC 11 it's just too become too much IMO.

  • Source/cmake/WebKitCompilerFlags.cmake:

Source/JavaScriptCore:

  • b3/air/AirAllocateRegistersByGraphColoring.cpp:
  • jit/JITCall.cpp:

(JSC::JIT::compileOpCall):

Source/WebCore:

  • css/CSSValue.h:

(WebCore::CSSValue::deref):

  • css/StyleRule.h:

(WebCore::StyleRuleBase::deref const):

  • dom/Node.h:

(WebCore::Node::deref const):

Source/WebKit:

  • WebProcess/Plugins/PluginView.cpp:

(WebKit::PluginView::Stream::~Stream):

Source/WTF:

  • wtf/Bitmap.h:

(WTF::WordType>::clear):

  • wtf/Compiler.h:
  • wtf/Packed.h:

(WTF::PackedAlignedPtr::get const):

  • wtf/RefPtr.h:

(WTF::DefaultRefDerefTraits::derefIfNotNull):

Location:
trunk
Files:
16 edited

Legend:

Unmodified
Added
Removed
  • trunk/ChangeLog

    r280469 r280689  
     12021-08-05  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
     4        https://bugs.webkit.org/show_bug.cgi?id=228601
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        Prior to GCC 11, these were good warnings that could catch serious errors. But GCC 11 has
     9        just become too sensitive and it's flagging what appear to be harmless cases, and not
     10        providing enough feedback to know why. This has resulted in me littering our code with
     11        pragmas to suppress GCC's false positives, and I think it's reached the point where it's
     12        nicer to just turn off the warnings until such time that GCC gets this under control, and
     13        rely on Clang instead in the meantime.
     14
     15        The GCC developers have indicated that these warnings will *always* produce false positives
     16        in some circumstances, but with GCC 11 it's just too become too much IMO.
     17
     18        * Source/cmake/WebKitCompilerFlags.cmake:
     19
    1202021-07-30  Adrian Perez de Castro  <aperez@igalia.com>
    221
  • trunk/Source/JavaScriptCore/ChangeLog

    r280687 r280689  
     12021-08-05  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
     4        https://bugs.webkit.org/show_bug.cgi?id=228601
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * b3/air/AirAllocateRegistersByGraphColoring.cpp:
     9        * jit/JITCall.cpp:
     10        (JSC::JIT::compileOpCall):
     11
    1122021-08-05  Zan Dobersek  <zdobersek@igalia.com>
    213
  • trunk/Source/JavaScriptCore/b3/air/AirAllocateRegistersByGraphColoring.cpp

    r278878 r280689  
    14671467            dataLog("FATAL: No color for ", tmp, "\n");
    14681468            dataLog("Code:\n");
    1469 // https://bugs.webkit.org/show_bug.cgi?id=224782
    1470 IGNORE_ARRAY_BOUNDS_WARNINGS_BEGIN
    14711469            dataLog(m_code);
    1472 IGNORE_ARRAY_BOUNDS_WARNINGS_END
    14731470            RELEASE_ASSERT_NOT_REACHED();
    14741471        }
     
    14851482    void initializePrecoloredTmp()
    14861483    {
    1487 // https://bugs.webkit.org/show_bug.cgi?id=224782
    1488 IGNORE_ARRAY_BOUNDS_WARNINGS_BEGIN
    14891484        m_coloredTmp.resize(m_lastPrecoloredRegisterIndex + 1);
    14901485        for (unsigned i = 1; i <= m_lastPrecoloredRegisterIndex; ++i) {
     
    14931488            m_coloredTmp[i] = tmp.reg();
    14941489        }
    1495 IGNORE_ARRAY_BOUNDS_WARNINGS_END
    14961490    }
    14971491
  • trunk/Source/JavaScriptCore/jit/JITCall.cpp

    r278816 r280689  
    254254    }
    255255
    256 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN
    257256    auto slowPaths = info->emitFastPath(*this, regT0, regT2, CallLinkInfo::UseDataIC::Yes);
    258 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END
    259257    auto doneLocation = label();
    260258    addSlowCase(slowPaths);
  • trunk/Source/WTF/ChangeLog

    r280683 r280689  
     12021-08-05  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
     4        https://bugs.webkit.org/show_bug.cgi?id=228601
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * wtf/Bitmap.h:
     9        (WTF::WordType>::clear):
     10        * wtf/Compiler.h:
     11        * wtf/Packed.h:
     12        (WTF::PackedAlignedPtr::get const):
     13        * wtf/RefPtr.h:
     14        (WTF::DefaultRefDerefTraits::derefIfNotNull):
     15
    1162021-08-05  Zan Dobersek  <zdobersek@igalia.com>
    217
  • trunk/Source/WTF/wtf/Bitmap.h

    r280544 r280689  
    235235inline void Bitmap<bitmapSize, WordType>::clear(size_t n)
    236236{
    237 IGNORE_ARRAY_BOUNDS_WARNINGS_BEGIN
    238237    bits[n / wordSize] &= ~(one << (n % wordSize));
    239 IGNORE_ARRAY_BOUNDS_WARNINGS_END
    240238}
    241239
  • trunk/Source/WTF/wtf/Compiler.h

    r279073 r280689  
    514514#define IGNORE_NULL_CHECK_WARNINGS_END IGNORE_WARNINGS_END
    515515
    516 #define IGNORE_ARRAY_BOUNDS_WARNINGS_BEGIN IGNORE_WARNINGS_BEGIN("array-bounds")
    517 #define IGNORE_ARRAY_BOUNDS_WARNINGS_END IGNORE_WARNINGS_END
    518 
    519 /* https://bugs.webkit.org/show_bug.cgi?id=224452 */
    520 #define IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN IGNORE_GCC_WARNINGS_BEGIN("nonnull")
    521 #define IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END IGNORE_GCC_WARNINGS_END
    522 
    523516/* NO_UNIQUE_ADDRESS */
    524517
  • trunk/Source/WTF/wtf/Packed.h

    r279028 r280689  
    143143        uintptr_t value = 0;
    144144
    145 IGNORE_ARRAY_BOUNDS_WARNINGS_BEGIN
    146145#if CPU(LITTLE_ENDIAN)
    147146        memcpy(&value, m_storage.data(), storageSize);
     
    149148        memcpy(bitwise_cast<uint8_t*>(&value) + (sizeof(void*) - storageSize), m_storage.data(), storageSize);
    150149#endif
    151 IGNORE_ARRAY_BOUNDS_WARNINGS_END
    152150
    153151        if (isAlignmentShiftProfitable)
  • trunk/Source/WTF/wtf/RefPtr.h

    r276332 r280689  
    3939    static ALWAYS_INLINE void derefIfNotNull(T* ptr)
    4040    {
    41 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN
    4241        if (LIKELY(ptr != nullptr))
    4342            ptr->deref();
    44 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END
    4543    }
    4644};
  • trunk/Source/WebCore/ChangeLog

    r280686 r280689  
     12021-08-05  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
     4        https://bugs.webkit.org/show_bug.cgi?id=228601
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * css/CSSValue.h:
     9        (WebCore::CSSValue::deref):
     10        * css/StyleRule.h:
     11        (WebCore::StyleRuleBase::deref const):
     12        * dom/Node.h:
     13        (WebCore::Node::deref const):
     14
    1152021-08-05  Rob Buis  <rbuis@igalia.com>
    216
  • trunk/Source/WebCore/css/CSSValue.h

    r278540 r280689  
    7171        unsigned tempRefCount = m_refCount - refCountIncrement;
    7272        if (!tempRefCount) {
    73 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN
    7473            destroy();
    75 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END
    7674            return;
    7775        }
  • trunk/Source/WebCore/css/StyleRule.h

    r276332 r280689  
    278278{
    279279    if (derefBase())
    280 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN
    281280        const_cast<StyleRuleBase&>(*this).destroy();
    282 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END
    283281}
    284282
  • trunk/Source/WebCore/dom/Node.h

    r279866 r280689  
    796796        m_inRemovedLastRefFunction = true;
    797797#endif
    798 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN
    799798        const_cast<Node&>(*this).removedLastRef();
    800 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END
    801799        return;
    802800    }
  • trunk/Source/WebKit/ChangeLog

    r280681 r280689  
     12021-08-05  Michael Catanzaro  <mcatanzaro@gnome.org>
     2
     3        GCC 11 builds should use -Wno-array-bounds, -Wno-nonnull
     4        https://bugs.webkit.org/show_bug.cgi?id=228601
     5
     6        Reviewed by Carlos Garcia Campos.
     7
     8        * WebProcess/Plugins/PluginView.cpp:
     9        (WebKit::PluginView::Stream::~Stream):
     10
    1112021-08-05  Imanol Fernandez  <ifernandez@igalia.com>
    212
  • trunk/Source/WebKit/WebProcess/Plugins/PluginView.cpp

    r278516 r280689  
    146146};
    147147
    148 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_BEGIN
    149148PluginView::Stream::~Stream()
    150149{
     
    153152    ASSERT(!m_pluginView);
    154153}
    155 IGNORE_ERRONEOUS_GCC_NULL_CHECK_WARNINGS_END
    156154   
    157155void PluginView::Stream::start()
  • trunk/Source/cmake/WebKitCompilerFlags.cmake

    r276129 r280689  
    137137    endif ()
    138138
     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")
     142        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-array-bounds)
     143        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-nonnull)
     144    endif ()
     145
    139146    # -Wexpansion-to-defined produces false positives with GCC but not Clang
    140147    # https://bugs.webkit.org/show_bug.cgi?id=167643#c13
    141     if (CMAKE_COMPILER_IS_GNUCXX)
     148    if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
    142149        WEBKIT_PREPEND_GLOBAL_COMPILER_FLAGS(-Wno-expansion-to-defined)
    143150    endif ()
Note: See TracChangeset for help on using the changeset viewer.