Fix compiler warnings when building with GCC 7
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 01:48:49 +0000 (01:48 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Jul 2017 01:48:49 +0000 (01:48 +0000)
https://bugs.webkit.org/show_bug.cgi?id=174463

Reviewed by Darin Adler.

.:

* Source/cmake/OptionsCommon.cmake:

Source/JavaScriptCore:

* disassembler/udis86/udis86_decode.c:
(decode_operand):

Source/ThirdParty:

* brotli/CMakeLists.txt:

Source/WebCore:

* testing/InternalSettings.cpp:
(WebCore::InternalSettings::setShouldManageAudioSessionCategory):

Source/WebKit2:

* Platform/IPC/unix/ConnectionUnix.cpp:
(IPC::Connection::sendOutputMessage):

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

ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/disassembler/udis86/udis86_decode.c
Source/ThirdParty/ChangeLog
Source/ThirdParty/brotli/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/testing/InternalSettings.cpp
Source/WebKit2/ChangeLog
Source/WebKit2/Platform/IPC/unix/ConnectionUnix.cpp
Source/cmake/OptionsCommon.cmake

index 0e560f1..5f3b130 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix compiler warnings when building with GCC 7
+        https://bugs.webkit.org/show_bug.cgi?id=174463
+
+        Reviewed by Darin Adler.
+
+        * Source/cmake/OptionsCommon.cmake:
+
 2017-07-12  Matt Lewis  <jlewis3@apple.com>
 
         Unreviewed, rolling out r219401.
index 8c4a2dc..691e49f 100644 (file)
@@ -1,5 +1,15 @@
 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
 
+        Fix compiler warnings when building with GCC 7
+        https://bugs.webkit.org/show_bug.cgi?id=174463
+
+        Reviewed by Darin Adler.
+
+        * disassembler/udis86/udis86_decode.c:
+        (decode_operand):
+
+2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
+
         Incorrect assertion in JSC::CallLinkInfo::callTypeFor
         https://bugs.webkit.org/show_bug.cgi?id=174467
 
index c0ea283..2533012 100644 (file)
@@ -749,12 +749,12 @@ decode_operand(struct ud           *u,
       break;
     case OP_F:
       u->br_far  = 1;
-      /* intended fall through */
+      FALLTHROUGH;
     case OP_M:
       if (MODRM_MOD(modrm(u)) == 3) {
         UDERR(u, "expected modrm.mod != 3\n");
       }
-      /* intended fall through */
+      FALLTHROUGH;
     case OP_E:
       decode_modrm_rm(u, operand, REGCLASS_GPR, size);
       break;
@@ -773,7 +773,7 @@ decode_operand(struct ud           *u,
       if (MODRM_MOD(modrm(u)) != 3) {
         UDERR(u, "expected modrm.mod == 3\n");
       }
-      /* intended fall through */
+      FALLTHROUGH;
     case OP_Q:
       decode_modrm_rm(u, operand, REGCLASS_MMX, size);
       break;
@@ -784,7 +784,7 @@ decode_operand(struct ud           *u,
       if (MODRM_MOD(modrm(u)) != 3) {
         UDERR(u, "expected modrm.mod == 3\n");
       }
-      /* intended fall through */
+      FALLTHROUGH;
     case OP_W:
       decode_modrm_rm(u, operand, REGCLASS_XMM, size);
       break;
index d17e2a1..7ebf1a2 100644 (file)
@@ -1,3 +1,12 @@
+2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix compiler warnings when building with GCC 7
+        https://bugs.webkit.org/show_bug.cgi?id=174463
+
+        Reviewed by Darin Adler.
+
+        * brotli/CMakeLists.txt:
+
 2017-05-11  Don Olmstead  <don.olmstead@am.sony.com>
 
         [CMake] Add HAVE check for regex.h
index 2c406da..16620e1 100644 (file)
@@ -17,6 +17,6 @@ add_definitions(-DBROTLI_BUILD_PORTABLE)
 add_library(brotli STATIC ${BROTLI_SOURCES})
 WEBKIT_SET_EXTRA_COMPILER_FLAGS(brotli)
 
-if (COMPILER_IS_CLANG)
-    ADD_TARGET_PROPERTIES(brotli COMPILE_FLAGS "-Wno-cast-align")
+if (COMPILER_IS_GCC_OR_CLANG)
+    ADD_TARGET_PROPERTIES(brotli COMPILE_FLAGS "-Wno-cast-align -Wno-implicit-fallthrough")
 endif ()
index d60b989..398ccaf 100644 (file)
@@ -1,5 +1,15 @@
 2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
 
+        Fix compiler warnings when building with GCC 7
+        https://bugs.webkit.org/show_bug.cgi?id=174463
+
+        Reviewed by Darin Adler.
+
+        * testing/InternalSettings.cpp:
+        (WebCore::InternalSettings::setShouldManageAudioSessionCategory):
+
+2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
+
         Incorrect call to StyledElement::setInlineStyleProperty in ImageDocument::createDocumentStructure
         https://bugs.webkit.org/show_bug.cgi?id=174470
 
index f04fe27..12d19d0 100644 (file)
@@ -842,6 +842,7 @@ ExceptionOr<void> InternalSettings::setShouldManageAudioSessionCategory(bool sho
     Settings::setShouldManageAudioSessionCategory(should);
     return { };
 #else
+    UNUSED_PARAM(should);
     return Exception { INVALID_ACCESS_ERR };
 #endif
 }
index e052b2d..2e240f9 100644 (file)
@@ -1,3 +1,13 @@
+2017-07-13  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        Fix compiler warnings when building with GCC 7
+        https://bugs.webkit.org/show_bug.cgi?id=174463
+
+        Reviewed by Darin Adler.
+
+        * Platform/IPC/unix/ConnectionUnix.cpp:
+        (IPC::Connection::sendOutputMessage):
+
 2017-07-13  Chris Dumez  <cdumez@apple.com>
 
         Moved filesystem code out of WebResourceLoadStatisticsStore class
index f71d2f7..203c56a 100644 (file)
@@ -452,7 +452,7 @@ bool Connection::sendOutputMessage(UnixMessage& outputMessage)
             switch (attachments[i].type()) {
             case Attachment::MappedMemoryType:
                 attachmentInfo[i].setSize(attachments[i].size());
-                // Fall trhough, set file descriptor or null.
+                FALLTHROUGH;
             case Attachment::SocketType:
                 if (attachments[i].fileDescriptor() != -1) {
                     ASSERT(fdPtr);
index 61a0ae7..26fc0af 100644 (file)
@@ -44,6 +44,8 @@ if (CMAKE_GENERATOR STREQUAL "Ninja")
     endif ()
 endif ()
 
+# FIXME: Some warning flags should probably be set in WebKitHelpers.cmake instead.
+# But language-specific warnings probably cannot be moved there.
 if (COMPILER_IS_GCC_OR_CLANG)
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fno-strict-aliasing")
     set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing")
@@ -71,6 +73,10 @@ if (COMPILER_IS_GCC_OR_CLANG)
         set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-expansion-to-defined")
         set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-expansion-to-defined")
     endif ()
+
+    if (CMAKE_COMPILER_IS_GNUCXX AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER "7.0")
+        set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-noexcept-type")
+    endif ()
 endif ()
 
 # Ensure that the default include system directories are added to the list of CMake implicit includes.