Summary: | TestWebKitAPI: Fix warnings found by new clang compiler | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Component: | Tools / Tests | Assignee: | David Kilzer (:ddkilzer) <ddkilzer> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | commit-queue, dbates, koivisto, lforschler, mcatanzaro, rniwa, thorton, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Unspecified | ||||||||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=185621 | ||||||||
Attachments: |
|
Description
David Kilzer (:ddkilzer)
2018-05-14 14:52:45 PDT
Created attachment 340365 [details]
Patch v1
Comment on attachment 340365 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=340365&action=review > Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp:178 > +#pragma clang diagnostic ignored "-Wunknown-pragmas" > +#pragma clang diagnostic ignored "-Wself-assign-overloaded" I think it would be good form to use two pops now to return the diagnostic stack to its original state, not that it matters. > Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm:88 > + unusedRect = WKRectGetValue(reinterpret_cast<WKRectRef>(items)); Can you not just drop the return value? Or cast the result to void? Comment on attachment 340365 [details]
Patch v1
Oops, need to fix the pragmas.
Comment on attachment 340365 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=340365&action=review >> Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp:178 >> +#pragma clang diagnostic ignored "-Wself-assign-overloaded" > > I think it would be good form to use two pops now to return the diagnostic stack to its original state, not that it matters. That's not how #pragma clang diagnostic push works. See the next function below this. >> Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm:88 >> + unusedRect = WKRectGetValue(reinterpret_cast<WKRectRef>(items)); > > Can you not just drop the return value? Or cast the result to void? Since it returns a struct, I didn't check whether I could cast to void. I also toyed with adding some assertions (like EXPECT_TRUE(rect.size.width != 0 && rect.size.height != 0). Maybe I'll do that instead. Comment on attachment 340365 [details] Patch v1 View in context: https://bugs.webkit.org/attachment.cgi?id=340365&action=review >>> Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp:178 >>> +#pragma clang diagnostic ignored "-Wself-assign-overloaded" >> >> I think it would be good form to use two pops now to return the diagnostic stack to its original state, not that it matters. > > That's not how #pragma clang diagnostic push works. See the next function below this. Whoops, yes... one push, one pop, of course. Created attachment 340390 [details]
Patch v2
Comment on attachment 340390 [details] Patch v2 Clearing flags on attachment: 340390 Committed r231806: <https://trac.webkit.org/changeset/231806> All reviewed patches have been landed. Closing bug. |