Building WebKit with a newer clang compiler emits a few new warnings in various TestWebKitAPI sources: Tools/TestWebKitAPI/Tests/WebKit/FindMatches.mm:88:18: error: explicitly assigning value of variable of type 'WKRect' to itself [-Werror,-Wself-assign-overloaded] rect = rect; ~~~~ ^ ~~~~ 1 error generated. In file included from Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:26: In file included from Tools/TestWebKitAPI/config.h:59: Debug/gtest.framework/Headers/gtest.h:1263:16: error: comparison of integers of different signs: 'const long' and 'const (anonymous enum at Debug/WebKit.framework/PrivateHeaders/WKWebViewPrivate.h:88:9)' [-Werror,-Wsign-compare] if (expected == actual) { ~~~~~~~~ ^ ~~~~~~ Debug/gtest.framework/Headers/gtest.h:1299:12: note: in instantiation of function template specialization 'testing::internal::CmpHelperEQ<long, (anonymous enum at Debug/WebKit.framework/PrivateHeaders/WKWebViewPrivate.h:88:9)>' requested here return CmpHelperEQ(expected_expression, actual_expression, expected, ^ Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:663:5: note: in instantiation of function template specialization 'testing::internal::EqHelper<false>::Compare<long, (anonymous enum at Debug/WebKit.framework/PrivateHeaders/WKWebViewPrivate.h:88:9)>' requested here EXPECT_EQ([[change objectForKey:NSKeyValueChangeOldKey] integerValue], _WKRectEdgeAll); ^ In file included from Tools/TestWebKitAPI/Tests/WebKitCocoa/UIDelegate.mm:26: In file included from Tools/TestWebKitAPI/config.h:59: Debug/gtest.framework/Headers/gtest.h:1761:67: note: expanded from macro 'EXPECT_EQ' EqHelper<GTEST_IS_NULL_LITERAL_(expected)>::Compare, \ ^ 1 error generated. Tools/TestWebKitAPI/Tests/WTF/NakedPtr.cpp:175:13: error: explicitly assigning value of variable of type 'NakedPtr<TestWebKitAPI::RefLogger>' to itself [-Werror,-Wself-assign-overloaded] ptr = ptr; ~~~ ^ ~~~ 1 error generated. Tools/TestWebKitAPI/Tests/WTF/Poisoned.cpp:482:13: error: explicitly assigning value of variable of type 'Poisoned<TestWebKitAPI::(anonymous namespace)::TestPoisonA, TestWebKitAPI::RefLogger *>' (aka 'Poisoned<Poison<g_testPoisonA>, TestWebKitAPI::RefLogger *>') to itself [-Werror,-Wself-assign-overloaded] ptr = ptr; ~~~ ^ ~~~ 1 error generated. Tools/TestWebKitAPI/Tests/WTF/PoisonedRefPtr.cpp:307:13: error: explicitly assigning value of variable of type 'PoisonedRefPtr<TestWebKitAPI::(anonymous namespace)::PoisonE, TestWebKitAPI::RefLogger>' (aka 'WTF::RefPtr<TestWebKitAPI::RefLogger, WTF::PoisonedPtrTraits<WTF::Poison<&TestWebKitAPI::(anonymous namespace)::g_poisonE>, TestWebKitAPI::RefLogger> >') to itself [-Werror,-Wself-assign-overloaded] ptr = ptr; ~~~ ^ ~~~ Tools/TestWebKitAPI/Tests/WTF/RefPtr.cpp:263:13: error: explicitly assigning value of variable of type 'RefPtr<TestWebKitAPI::RefLogger>' to itself [-Werror,-Wself-assign-overloaded] ptr = ptr; ~~~ ^ ~~~ 1 error generated.
<rdar://problem/40234123>
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.