Fix a bunch of compiler warnings
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 18:03:56 +0000 (18:03 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 10 May 2019 18:03:56 +0000 (18:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197785

Reviewed by Don Olmstead.

Source/ThirdParty/ANGLE:

Add compiler flags to suppress various warnings triggered by the new version of ANGLE.

* CMakeLists.txt:

Source/WebCore:

* CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes.
* PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings.
* inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning.
* rendering/RenderLayer.cpp: Fix unused variable warning.
(WebCore::RenderLayer::updateClipRects):

Source/WebKit:

Guard Cocoa-specific format modifier to avoid -Wformat warning.

* NetworkProcess/AdClickAttributionManager.cpp:
(WebKit::AdClickAttributionManager::fireConversionRequest):

Tools:

Add preprocessor guards to avoid -Wunused-function warnings.

* TestWebKitAPI/Tests/WebCore/FloatRect.cpp:
* TestWebKitAPI/Tests/WebCore/IntRect.cpp:
* TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245179 268f45cc-cd09-0410-ab3c-d52691b4dbfc

13 files changed:
Source/ThirdParty/ANGLE/CMakeLists.txt
Source/ThirdParty/ANGLE/ChangeLog
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/inspector/InspectorCanvas.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebKit/ChangeLog
Source/WebKit/NetworkProcess/AdClickAttributionManager.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/Tests/WebCore/FloatRect.cpp
Tools/TestWebKitAPI/Tests/WebCore/IntRect.cpp
Tools/TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp

index 692ae54..4726c8b 100644 (file)
@@ -149,7 +149,11 @@ else ()
 endif ()
 
 if (COMPILER_IS_GCC_OR_CLANG)
-    WEBKIT_ADD_TARGET_CXX_FLAGS(ANGLE -Wno-cast-align -Wno-unused-parameter)
+    WEBKIT_ADD_TARGET_CXX_FLAGS(ANGLE -Wno-cast-align
+                                      -Wno-suggest-attribute=format
+                                      -Wno-type-limits
+                                      -Wno-undef
+                                      -Wno-unused-parameter)
 endif ()
 
 target_link_libraries(ANGLEFramework INTERFACE ANGLE)
index da940b5..13c7d72 100644 (file)
@@ -1,3 +1,14 @@
+2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix a bunch of compiler warnings
+        https://bugs.webkit.org/show_bug.cgi?id=197785
+
+        Reviewed by Don Olmstead.
+
+        Add compiler flags to suppress various warnings triggered by the new version of ANGLE.
+
+        * CMakeLists.txt:
+
 2019-05-09  Don Olmstead  <don.olmstead@sony.com>
 
         [ANGLE] Update ANGLE
index e65a5e0..fd99e7d 100644 (file)
@@ -1972,7 +1972,7 @@ add_library(WebCoreTestSupport ${WebCoreTestSupport_LIBRARY_TYPE} ${WebCoreTestS
 add_dependencies(WebCoreTestSupport WebCore WebCoreTestSupportBindings)
 target_include_directories(WebCoreTestSupport PUBLIC ${WebCoreTestSupport_INCLUDE_DIRECTORIES} ${WebCore_INCLUDE_DIRECTORIES})
 target_include_directories(WebCoreTestSupport PRIVATE ${WebCoreTestSupport_PRIVATE_INCLUDE_DIRECTORIES} ${WebCore_PRIVATE_INCLUDE_DIRECTORIES})
-target_include_directories(WebCoreTestSupport SYSTEM PUBLIC ${WebCore_SYSTEM_INCLUDE_DIRECTORIES})
+target_include_directories(WebCoreTestSupport SYSTEM PUBLIC ${WebCoreTestSupport_SYSTEM_INCLUDE_DIRECTORIES} ${WebCore_SYSTEM_INCLUDE_DIRECTORIES})
 target_link_libraries(WebCoreTestSupport PRIVATE ${WebCoreTestSupport_LIBRARIES})
 
 if (WebCoreTestSupport_OUTPUT_NAME)
index 227dd90..e074249 100644 (file)
@@ -1,3 +1,16 @@
+2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix a bunch of compiler warnings
+        https://bugs.webkit.org/show_bug.cgi?id=197785
+
+        Reviewed by Don Olmstead.
+
+        * CMakeLists.txt: WebCoreTestSupport should accept extra SYSTEM includes.
+        * PlatformGTK.cmake: GTK includes should be added to SYSTEM headers to avoid warnings.
+        * inspector/InspectorCanvas.cpp: Add preprocessor guards to fix unused function warning.
+        * rendering/RenderLayer.cpp: Fix unused variable warning.
+        (WebCore::RenderLayer::updateClipRects):
+
 2019-05-10  Antti Koivisto  <antti@apple.com>
 
         Event region generation needs to know about backing-sharing
index 856a005..9f82b4f 100644 (file)
@@ -214,7 +214,7 @@ include_directories(SYSTEM
 )
 
 list(APPEND WebCoreTestSupport_LIBRARIES PRIVATE ${GTK_LIBRARIES})
-list(APPEND WebCoreTestSupport_INCLUDE_DIRECTORIES ${GTK_INCLUDE_DIRS})
+list(APPEND WebCoreTestSupport_SYSTEM_INCLUDE_DIRECTORIES ${GTK_INCLUDE_DIRS})
 
 add_definitions(-DBUILDING_WEBKIT)
 
index e38f2dc..8782753 100644 (file)
@@ -138,13 +138,16 @@ static bool shouldSnapshotBitmapRendererAction(const String& name)
     return name == "transferFromImageBitmap";
 }
 
+#if ENABLE(WEBGL)
 static bool shouldSnapshotWebGLAction(const String& name)
 {
     return name == "clear"
         || name == "drawArrays"
         || name == "drawElements";
 }
+#endif
 
+#if ENABLE(WEBGL2)
 static bool shouldSnapshotWebGL2Action(const String& name)
 {
     return name == "clear"
@@ -153,6 +156,7 @@ static bool shouldSnapshotWebGL2Action(const String& name)
         || name == "drawElements"
         || name == "drawElementsInstanced";
 }
+#endif
 
 void InspectorCanvas::recordAction(const String& name, Vector<RecordCanvasActionVariant>&& parameters)
 {
index a25dbd1..b062d0b 100644 (file)
@@ -5500,7 +5500,7 @@ Ref<ClipRects> RenderLayer::updateClipRects(const ClipRectsContext& clipRectsCon
     RefPtr<ClipRects> parentClipRects;
     // For transformed layers, the root layer was shifted to be us, so there is no need to
     // examine the parent. We want to cache clip rects with us as the root.
-    if (auto* parentLayer = (clipRectsContext.rootLayer != this ? parent() : nullptr))
+    if (clipRectsContext.rootLayer != this && parent())
         parentClipRects = this->parentClipRects(clipRectsContext);
 
     auto clipRects = ClipRects::create();
index 8382293..a39e573 100644 (file)
@@ -1,3 +1,15 @@
+2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix a bunch of compiler warnings
+        https://bugs.webkit.org/show_bug.cgi?id=197785
+
+        Reviewed by Don Olmstead.
+
+        Guard Cocoa-specific format modifier to avoid -Wformat warning.
+
+        * NetworkProcess/AdClickAttributionManager.cpp:
+        (WebKit::AdClickAttributionManager::fireConversionRequest):
+
 2019-05-10  Chris Fleizach  <cfleizach@apple.com>
 
         AX: Crash at WebKit: WebKit::WebSpeechSynthesisClient::speak
index 1f081b8..1d7b133 100644 (file)
@@ -181,7 +181,11 @@ void AdClickAttributionManager::fireConversionRequest(const AdClickAttribution&
     RELEASE_LOG_INFO_IF(debugModeEnabled(), AdClickAttribution, "About to fire an attribution request for a conversion.");
 
     m_pingLoadFunction(WTFMove(loadParameters), [](const WebCore::ResourceError& error, const WebCore::ResourceResponse& response) {
+#if PLATFORM(COCOA)
         RELEASE_LOG_ERROR_IF(!error.isNull(), AdClickAttribution, "Received error: '%{public}s' for ad click attribution request.", error.localizedDescription().utf8().data());
+#else
+        RELEASE_LOG_ERROR_IF(!error.isNull(), AdClickAttribution, "Received error: '%s' for ad click attribution request.", error.localizedDescription().utf8().data());
+#endif
         UNUSED_PARAM(response);
         UNUSED_PARAM(error);
     });
index cef2eaa..940e3ff 100644 (file)
@@ -1,5 +1,18 @@
 2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
 
+        Fix a bunch of compiler warnings
+        https://bugs.webkit.org/show_bug.cgi?id=197785
+
+        Reviewed by Don Olmstead.
+
+        Add preprocessor guards to avoid -Wunused-function warnings.
+
+        * TestWebKitAPI/Tests/WebCore/FloatRect.cpp:
+        * TestWebKitAPI/Tests/WebCore/IntRect.cpp:
+        * TestWebKitAPI/Tests/WebCore/TransformationMatrix.cpp:
+
+2019-05-10  Michael Catanzaro  <mcatanzaro@igalia.com>
+
         [WPE][GTK] Add webkit_frame_get_id() API
         https://bugs.webkit.org/show_bug.cgi?id=197270
 
index 30e6d7c..ef6db01 100644 (file)
@@ -603,6 +603,7 @@ TEST(FloatRect, FitToPoints)
     EXPECT_FLOAT_EQ(190.0f, rect.maxY());
 }
 
+#if USE(CG) || PLATFORM(WIN)
 static void checkCastRect(const WebCore::FloatRect& rect)
 {
     EXPECT_FLOAT_EQ(10.0f, rect.x());
@@ -612,6 +613,7 @@ static void checkCastRect(const WebCore::FloatRect& rect)
     EXPECT_FLOAT_EQ(30.0f, rect.width());
     EXPECT_FLOAT_EQ(40.0f, rect.height());
 }
+#endif
 
 TEST(FloatRect, Casting)
 {
index 7392f06..0793eaa 100644 (file)
@@ -481,6 +481,7 @@ TEST(IntRect, Transpose)
     EXPECT_EQ(120, transposed.maxY());
 }
 
+#if USE(CG) || PLATFORM(WIN)
 static void checkCastRect(const WebCore::IntRect& rect)
 {
     EXPECT_EQ(10, rect.x());
@@ -490,6 +491,7 @@ static void checkCastRect(const WebCore::IntRect& rect)
     EXPECT_EQ(30, rect.width());
     EXPECT_EQ(40, rect.height());
 }
+#endif
 
 TEST(IntRect, Casting)
 {
@@ -584,6 +586,7 @@ TEST(IntRect, Equality)
     ASSERT_FALSE(rect == rightSide);
 }
 
+#if USE(CG)
 static void checkEnclosingIntRect(const WebCore::IntRect& rect)
 {
     EXPECT_EQ(10, rect.x());
@@ -593,6 +596,7 @@ static void checkEnclosingIntRect(const WebCore::IntRect& rect)
     EXPECT_EQ(31, rect.width());
     EXPECT_EQ(41, rect.height());
 }
+#endif
 
 TEST(IntRect, EnclosingIntRect)
 {
index 79feecf..197d213 100644 (file)
@@ -1187,6 +1187,7 @@ TEST(TransformationMatrix, Equality)
     ASSERT_TRUE(test3 != test4);
 }
 
+#if USE(CA)
 static void testTranslationMatrix(const WebCore::TransformationMatrix& matrix)
 {
     EXPECT_DOUBLE_EQ(1.0, matrix.m11());
@@ -1206,6 +1207,7 @@ static void testTranslationMatrix(const WebCore::TransformationMatrix& matrix)
     EXPECT_DOUBLE_EQ(30.0, matrix.m43());
     EXPECT_DOUBLE_EQ(1.0, matrix.m44());
 }
+#endif
 
 TEST(TransformationMatrix, Casting)
 {