[Webkit-unassigned] [Bug 224452] New: RefPtr.h:42:23: warning: ‘this’ pointer is null [-Wnonnull]

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 12 14:11:23 PDT 2021


https://bugs.webkit.org/show_bug.cgi?id=224452

            Bug ID: 224452
           Summary: RefPtr.h:42:23: warning: ‘this’ pointer is null
                    [-Wnonnull]
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Web Template Framework
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: mcatanzaro at gnome.org

With GCC 11, we have a warning spam coming from RefPtr.h. Let's silence it using IGNORE_WARNING_BEGIN/END:

[1019/5391] Building CXX object Tools/TestWebKitAPI/CMakeFiles/TestWTF.dir/Tests/WTF/HashMap.cpp.o
In file included from WTF/Headers/wtf/HashFunctions.h:26,
                 from ../../Tools/TestWebKitAPI/Tests/WTF/DeletedAddressOfOperator.h:28,
                 from ../../Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp:30:
In static member function ‘static void WTF::DefaultRefDerefTraits< <template-parameter-1-1> >::derefIfNotNull(T*) [with T = TestWebKitAPI::RefLogger]’,
    inlined from ‘WTF::RefPtr<T, <template-parameter-1-2>, <template-parameter-1-3> >::~RefPtr() [with T = TestWebKitAPI::RefLogger; _PtrTraits = WTF::RawPtrTraits<TestWebKitAPI::RefLogger>; _RefDerefTraits = WTF::DefaultRefDerefTraits<TestWebKitAPI::RefLogger>]’ at WTF/Headers/wtf/RefPtr.h:73:61,
    inlined from ‘virtual void TestWebKitAPI::WTF_HashMap_Ref_Value_Test::TestBody()’ at ../../Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp:977:36:
WTF/Headers/wtf/RefPtr.h:42:23: warning: ‘this’ pointer is null [-Wnonnull]
   42 |             ptr->deref();
      |             ~~~~~~~~~~^~
In file included from ../../Tools/TestWebKitAPI/Tests/WTF/HashMap.cpp:32:
../../Tools/TestWebKitAPI/Tests/WTF/RefLogger.h: In member function ‘virtual void TestWebKitAPI::WTF_HashMap_Ref_Value_Test::TestBody()’:
../../Tools/TestWebKitAPI/Tests/WTF/RefLogger.h:35:10: note: in a call to non-static member function ‘void TestWebKitAPI::RefLogger::deref()’
   35 |     void deref();
      |          ^~~~~

This is surely a GCC bug -- it's a static class function, so there is no 'this' pointer -- and I intend to report it to the GCC developers. But in the meantime, it would be nice to work around this in WebKit because the warning spam makes it hard to notice other warnings.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20210412/6cc4089f/attachment-0001.htm>


More information about the webkit-unassigned mailing list