Bug 150996 - Node.h:392:12: warning: 'this' pointer cannot be null in well-defined C++ code
Summary: Node.h:392:12: warning: 'this' pointer cannot be null in well-defined C++ code
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore Misc. (show other bugs)
Version: Other
Hardware: PC All
: P2 Normal
Assignee: Michael Catanzaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-07 07:13 PST by Michael Catanzaro
Modified: 2015-11-07 09:17 PST (History)
4 users (show)

See Also:


Attachments
Patch (1.20 KB, patch)
2015-11-07 07:29 PST, Michael Catanzaro
kling: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2015-11-07 07:13:14 PST
WebCore::Node::document begins with the line ASSERT(this), which is bogus. In Clang 3.7, this triggers a compiler warning for every file that includes Node.h:

../../Source/WebCore/dom/Node.h:392:12: warning: 'this' pointer cannot be null in well-defined C++ code; pointer may be assumed to always convert to true [-Wundefined-bool-conversion]
        (!(this) ? (WTFReportAssertionFailure("../../Source/WebCore/dom/Node.h", 392, __PRETTY_FUNCTION__, "this"), WTFCrash()) : (void)0);
         ~ ^~~~
1 warning generated.

Pretty sure GCC and Clang both optimize away this assertion, but I guess the warning is new. The fix is just to remove the assertion.
Comment 1 Michael Catanzaro 2015-11-07 07:29:54 PST
Created attachment 265002 [details]
Patch
Comment 2 Michael Catanzaro 2015-11-07 09:17:44 PST
Committed r192130: <http://trac.webkit.org/changeset/192130>