Title: [285652] trunk
Revision
285652
Author
[email protected]
Date
2021-11-11 13:09:39 -0800 (Thu, 11 Nov 2021)

Log Message

-Warray-bounds, -Wstringop-truncation, -Wstringop-overread warnings in Packed.h
https://bugs.webkit.org/show_bug.cgi?id=226557
<rdar://problem/79103658>

Patch by Michael Catanzaro <[email protected]> on 2021-11-11
Reviewed by Darin Adler.

.:

Suppress -Wstringop-overread for all of WebKit when building with GCC 11 or newer. This is
an unfortunate way to deal with false positives that we ought to be able to silence in just
a few places, but when warnings do not respect pragmas we have few alternatives, and trying
to remove derived sources from the unified build in order to build them with special flags
is just not worth the effort.

This is part of a larger trend of oversensitive warnings from GCC 11.

* Source/cmake/WebKitCompilerFlags.cmake:

Source/WebCore:

Since -Wstringop-overread is now suppressed globally, we can include WebSocket.cpp in the
unified build once again.

* CMakeLists.txt:
* Sources.txt:
* WebCore.xcodeproj/project.pbxproj:

Modified Paths

Diff

Modified: trunk/ChangeLog (285651 => 285652)


--- trunk/ChangeLog	2021-11-11 21:02:31 UTC (rev 285651)
+++ trunk/ChangeLog	2021-11-11 21:09:39 UTC (rev 285652)
@@ -1,3 +1,21 @@
+2021-11-11  Michael Catanzaro  <[email protected]>
+
+        -Warray-bounds, -Wstringop-truncation, -Wstringop-overread warnings in Packed.h
+        https://bugs.webkit.org/show_bug.cgi?id=226557
+        <rdar://problem/79103658>
+
+        Reviewed by Darin Adler.
+
+        Suppress -Wstringop-overread for all of WebKit when building with GCC 11 or newer. This is
+        an unfortunate way to deal with false positives that we ought to be able to silence in just
+        a few places, but when warnings do not respect pragmas we have few alternatives, and trying
+        to remove derived sources from the unified build in order to build them with special flags
+        is just not worth the effort.
+
+        This is part of a larger trend of oversensitive warnings from GCC 11.
+
+        * Source/cmake/WebKitCompilerFlags.cmake:
+
 2021-11-10  Kimmo Kinnunen  <[email protected]>
 
         Coding style for inner namespaces is should be simplified to not indented

Modified: trunk/Source/WebCore/CMakeLists.txt (285651 => 285652)


--- trunk/Source/WebCore/CMakeLists.txt	2021-11-11 21:02:31 UTC (rev 285651)
+++ trunk/Source/WebCore/CMakeLists.txt	2021-11-11 21:09:39 UTC (rev 285652)
@@ -2448,10 +2448,3 @@
         COMPILE_PDB_NAME ${WebCore_OUTPUT_NAME}
     )
 endif ()
-
-# Special compiler flags may be used for individual files only if the file is excluded from unified
-# build.
-if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
-    # This warning cannot be suppressed with a pragma.
-    set_source_files_properties(Modules/websockets/WebSocket.cpp PROPERTIES COMPILE_FLAGS -Wno-stringop-overread)
-endif ()

Modified: trunk/Source/WebCore/ChangeLog (285651 => 285652)


--- trunk/Source/WebCore/ChangeLog	2021-11-11 21:02:31 UTC (rev 285651)
+++ trunk/Source/WebCore/ChangeLog	2021-11-11 21:09:39 UTC (rev 285652)
@@ -1,3 +1,18 @@
+2021-11-11  Michael Catanzaro  <[email protected]>
+
+        -Warray-bounds, -Wstringop-truncation, -Wstringop-overread warnings in Packed.h
+        https://bugs.webkit.org/show_bug.cgi?id=226557
+        <rdar://problem/79103658>
+
+        Reviewed by Darin Adler.
+
+        Since -Wstringop-overread is now suppressed globally, we can include WebSocket.cpp in the
+        unified build once again.
+
+        * CMakeLists.txt:
+        * Sources.txt:
+        * WebCore.xcodeproj/project.pbxproj:
+
 2021-11-11  Ben Nham  <[email protected]>
 
         Log memory usage metadata when WebContent crosses critical or warning level memory thresholds

Modified: trunk/Source/WebCore/Sources.txt (285651 => 285652)


--- trunk/Source/WebCore/Sources.txt	2021-11-11 21:02:31 UTC (rev 285651)
+++ trunk/Source/WebCore/Sources.txt	2021-11-11 21:09:39 UTC (rev 285652)
@@ -388,7 +388,7 @@
 Modules/websockets/CloseEvent.cpp
 Modules/websockets/ThreadableWebSocketChannel.cpp
 Modules/websockets/ThreadableWebSocketChannelClientWrapper.cpp
-Modules/websockets/WebSocket.cpp @no-unify
+Modules/websockets/WebSocket.cpp
 Modules/websockets/WebSocketChannel.cpp
 Modules/websockets/WebSocketChannelInspector.cpp
 Modules/websockets/WebSocketDeflateFramer.cpp

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (285651 => 285652)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-11-11 21:02:31 UTC (rev 285651)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2021-11-11 21:09:39 UTC (rev 285652)
@@ -2909,7 +2909,6 @@
 		938430B42475DE40003F9617 /* DictationContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 938430B22475DE3F003F9617 /* DictationContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		93849C1F24BE404B00448D5A /* EmptyScriptExecutionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = 93849C1E24BE404A00448D5A /* EmptyScriptExecutionContext.h */; };
 		93849C2324BEDD8900448D5A /* JSIDBSerializationGlobalObject.h in Headers */ = {isa = PBXBuildFile; fileRef = 93849C2124BEDD8800448D5A /* JSIDBSerializationGlobalObject.h */; };
-		938CF24226BB728C00C09240 /* WebSocket.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 97AABCFF14FA09D5007457AE /* WebSocket.cpp */; };
 		938E65F109F09840008A48EC /* JSHTMLElementWrapperFactory.h in Headers */ = {isa = PBXBuildFile; fileRef = 938E65F009F09840008A48EC /* JSHTMLElementWrapperFactory.h */; };
 		938E666209F09B87008A48EC /* JSHTMLCanvasElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 938E666109F09B87008A48EC /* JSHTMLCanvasElement.h */; };
 		9391A991162746CB00297330 /* ScrollingCoordinatorMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 9391A990162746CB00297330 /* ScrollingCoordinatorMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
@@ -18936,11 +18935,11 @@
 		1A569CC40D7E2B60007C3983 /* bridge */ = {
 			isa = PBXGroup;
 			children = (
+				59B5977111086556007159E8 /* jsc */,
 				1A569CE20D7E2B82007C3983 /* objc */,
 				599E758F11055A1F00D904FA /* Bridge.h */,
 				1A71D5790F33819000F9CE4E /* IdentifierRep.cpp */,
 				1A71D57A0F33819000F9CE4E /* IdentifierRep.h */,
-				59B5977111086556007159E8 /* jsc */,
 				1A569CEF0D7E2B82007C3983 /* runtime_array.cpp */,
 				1A569CF00D7E2B82007C3983 /* runtime_array.h */,
 				1A569CF10D7E2B82007C3983 /* runtime_method.cpp */,
@@ -38150,7 +38149,6 @@
 				7C48A6D0191C9D6500026674 /* WebKitNamespace.cpp in Sources */,
 				07F5CFF62582A52900662EF5 /* WebMAudioUtilitiesCocoa.mm in Sources */,
 				1CAF34820A6C405200ABE06E /* WebScriptObject.mm in Sources */,
-				938CF24226BB728C00C09240 /* WebSocket.cpp in Sources */,
 				CECDC93C21F2972900976BD1 /* WebVideoFullscreenControllerAVKit.mm in Sources */,
 				A14832C2187F65C700DA63A6 /* WKUtilities.c in Sources */,
 				A833C7CC0A2CF07400D57664 /* XLinkNames.cpp in Sources */,

Modified: trunk/Source/cmake/WebKitCompilerFlags.cmake (285651 => 285652)


--- trunk/Source/cmake/WebKitCompilerFlags.cmake	2021-11-11 21:02:31 UTC (rev 285651)
+++ trunk/Source/cmake/WebKitCompilerFlags.cmake	2021-11-11 21:09:39 UTC (rev 285652)
@@ -143,6 +143,13 @@
         WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-nonnull)
     endif ()
 
+    # This triggers warnings in wtf/Packed.h, a header that is included in many places. It does not
+    # respect ignore warning pragmas and we cannot easily suppress it for all affected files.
+    # https://bugs.webkit.org/show_bug.cgi?id=226557
+    if (CMAKE_CXX_COMPILER_ID MATCHES "GNU" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER_EQUAL "11.0")
+        WEBKIT_PREPEND_GLOBAL_CXX_FLAGS(-Wno-stringop-overread)
+    endif ()
+
     # -Wexpansion-to-defined produces false positives with GCC but not Clang
     # https://bugs.webkit.org/show_bug.cgi?id=167643#c13
     if (CMAKE_CXX_COMPILER_ID MATCHES "GNU")
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to