[WPE] Build cleanly with GCC 8 and ICU 60
authormcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 May 2018 16:21:09 +0000 (16:21 +0000)
committermcatanzaro@igalia.com <mcatanzaro@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 May 2018 16:21:09 +0000 (16:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=185462

Reviewed by Carlos Alberto Lopez Perez.

Source/JavaScriptCore:

* API/glib/JSCClass.cpp: Silence many -Wcast-function-type warnings.
(jsc_class_add_constructor):
(jsc_class_add_method):
* API/glib/JSCValue.cpp: Silence many -Wcast-function-type warnings.
(jsc_value_object_define_property_accessor):
(jsc_value_new_function):
* CMakeLists.txt: Build BuiltinNames.cpp with -fno-var-tracking-assignments. This was a
problem with GCC 7 too, but might as well fix it now.
* assembler/ProbeContext.h:
(JSC::Probe::CPUState::gpr const): Silence a -Wclass-memaccess warning.
(JSC::Probe::CPUState::spr const): Ditto. Assume std::remove_const is safe to clobber.
* b3/air/AirArg.h:
(JSC::B3::Air::Arg::isRepresentableAs): Silence -Wfallthrough warning.
* builtins/BuiltinNames.cpp:
(JSC::BuiltinNames::BuiltinNames): Moved from BuiltinNames.h so we can use a special flag.
* builtins/BuiltinNames.h:
(JSC::BuiltinNames::BuiltinNames): Moved to BuiltinNames.cpp.
* dfg/DFGDoubleFormatState.h:
(JSC::DFG::mergeDoubleFormatStates): Silence -Wfallthrough warnings.
* heap/MarkedBlockInlines.h:
(JSC::MarkedBlock::Handle::finishSweepKnowingHeapCellType): Silence -Wfallthrough warnings.
* runtime/ConfigFile.cpp:
(JSC::ConfigFile::canonicalizePaths): Here GCC found a genuine mistake, strncat is called
with the wrong length parameter and the result is not null-terminated. Also, silence a
-Wstringop-truncation warning as we intentionally truncate filenames that exceed PATH_MAX.
* runtime/IntlDateTimeFormat.cpp:
(JSC::IntlDateTimeFormat::partTypeString): Avoid an ICU deprecation warning.
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::init): We were unconditionally running some BigInt code by accident.
(JSC::JSGlobalObject::visitChildren): Probably a serious bug? Fixed.

Source/ThirdParty:

* xdgmime/CMakeLists.txt: Silence -Wno-cast-function-type. I'm not fighting xdg-mime.

Source/WebCore:

* PlatformGTK.cmake: Include directories are in the wrong place.
* accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
(WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
(WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
(WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
(WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
* css/CSSFontFace.cpp: Silence -Wfallthrough
(WebCore::CSSFontFace::fontLoadTiming const):
* css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
(WebCore::CSSSelectorList::adoptSelectorVector):
* editing/TextIterator.cpp: Silence ICU deprecation warnings.
* platform/Length.h:
(WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
* platform/graphics/Gradient.cpp:
(WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
* platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
* platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
(WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
* platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
(WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
* platform/graphics/freetype/SimpleFontDataFreeType.cpp:
(WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
* platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
(gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
* platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
(WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
(WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
(WebCore::findHLSQueue): Fix -Wcast-function-type.
* platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
(webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
* platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
(WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
* platform/text/TextEncoding.cpp: Silence ICU deprecration.

Source/WebKit:

* Platform/IPC/glib/GSocketMonitor.cpp:
(IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
* Shared/API/glib/WebKitContextMenu.cpp:
(webkit_context_menu_new_with_items): Ditto.

Source/WTF:

* wtf/HashTable.h:
(WTF::HashTableBucketInitializer<true>::initialize): Since -Wclass-memaccess warning. This
is probably safe enough, since it's for an empty bucket.
* wtf/StdLibExtras.h:
(WTF::bitwise_cast): Silence -Wclass-memaccess as we use type traits to ensure safety here.
* wtf/Vector.h: Ditto, all uses are safe.
* wtf/glib/WTFGType.h: Silence -Wcast-function-type.

Tools:

* TestWebKitAPI/CMakeLists.txt: Fix weird build failure, we were missing a directory. Not
sure why this was never noticed until now or why the bots are OK.
* gtk/jhbuild.modules: Add upstream patch to avoid warnings inside G_DEFINE_TYPE.
* gtk/patches/glib-cast-function-type.patch: Added.
* wpe/jhbuild.modules: Add upstream patch to avoid warnings inside G_DEFINE_TYPE.
* wpe/patches/glib-cast-function-type.patch: Added.

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

46 files changed:
Source/JavaScriptCore/API/glib/JSCClass.cpp
Source/JavaScriptCore/API/glib/JSCValue.cpp
Source/JavaScriptCore/CMakeLists.txt
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/assembler/ProbeContext.h
Source/JavaScriptCore/b3/air/AirArg.h
Source/JavaScriptCore/builtins/BuiltinNames.cpp
Source/JavaScriptCore/builtins/BuiltinNames.h
Source/JavaScriptCore/dfg/DFGDoubleFormatState.h
Source/JavaScriptCore/heap/MarkedBlockInlines.h
Source/JavaScriptCore/runtime/ConfigFile.cpp
Source/JavaScriptCore/runtime/IntlDateTimeFormat.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/ThirdParty/ChangeLog
Source/ThirdParty/xdgmime/CMakeLists.txt
Source/WTF/ChangeLog
Source/WTF/wtf/HashTable.h
Source/WTF/wtf/StdLibExtras.h
Source/WTF/wtf/Vector.h
Source/WTF/wtf/glib/WTFGType.h
Source/WebCore/ChangeLog
Source/WebCore/PlatformGTK.cmake
Source/WebCore/accessibility/AXObjectCache.cpp
Source/WebCore/css/CSSFontFace.cpp
Source/WebCore/css/CSSSelectorList.cpp
Source/WebCore/editing/TextIterator.cpp
Source/WebCore/platform/Length.h
Source/WebCore/platform/graphics/Gradient.cpp
Source/WebCore/platform/graphics/SurrogatePairAwareTextIterator.cpp
Source/WebCore/platform/graphics/cairo/FontCairoHarfbuzzNG.cpp
Source/WebCore/platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp
Source/WebCore/platform/graphics/freetype/SimpleFontDataFreeType.cpp
Source/WebCore/platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp
Source/WebCore/platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp
Source/WebCore/platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp
Source/WebCore/platform/network/soup/SocketStreamHandleImplSoup.cpp
Source/WebCore/platform/text/TextEncoding.cpp
Source/WebKit/ChangeLog
Source/WebKit/Platform/IPC/glib/GSocketMonitor.cpp
Source/WebKit/Shared/API/glib/WebKitContextMenu.cpp
Tools/ChangeLog
Tools/TestWebKitAPI/CMakeLists.txt
Tools/gtk/jhbuild.modules
Tools/gtk/patches/glib-cast-function-type.patch [new file with mode: 0644]
Tools/wpe/jhbuild.modules
Tools/wpe/patches/glib-cast-function-type.patch [new file with mode: 0644]

index 6843398..841d37c 100644 (file)
@@ -563,7 +563,7 @@ JSCValue* jsc_class_add_constructor(JSCClass* jscClass, const char* name, GCallb
     }
     va_end(args);
 
-    GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(destroyNotify)));
+    GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify))));
     JSC::ExecState* exec = toJS(jscContextGetJSContext(priv->context));
     JSC::VM& vm = exec->vm();
     JSC::JSLockHolder locker(vm);
@@ -613,7 +613,7 @@ void jsc_class_add_method(JSCClass* jscClass, const char* name, GCallback callba
     }
     va_end(args);
 
-    GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(destroyNotify)));
+    GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify))));
     JSC::ExecState* exec = toJS(jscContextGetJSContext(priv->context));
     JSC::VM& vm = exec->vm();
     JSC::JSLockHolder locker(vm);
index 773f3e2..693ba10 100644 (file)
@@ -1003,14 +1003,14 @@ void jsc_value_object_define_property_accessor(JSCValue* value, const char* prop
     JSC::VM& vm = exec->vm();
     JSC::JSLockHolder locker(vm);
     if (getter) {
-        GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(getter, userData, reinterpret_cast<GClosureNotify>(destroyNotify)));
+        GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(getter, userData, reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify))));
         auto* functionObject = toRef(JSC::JSCCallbackFunction::create(vm, exec->lexicalGlobalObject(), ASCIILiteral("get"),
             JSC::JSCCallbackFunction::Type::Method, nullptr, WTFMove(closure), propertyType, { }));
         GRefPtr<JSCValue> function = jscContextGetOrCreateValue(priv->context.get(), functionObject);
         jsc_value_object_set_property(descriptor.get(), "get", function.get());
     }
     if (setter) {
-        GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(setter, userData, getter ? nullptr : reinterpret_cast<GClosureNotify>(destroyNotify)));
+        GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(setter, userData, getter ? nullptr : reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify))));
         auto* functionObject = toRef(JSC::JSCCallbackFunction::create(vm, exec->lexicalGlobalObject(), ASCIILiteral("set"),
             JSC::JSCCallbackFunction::Type::Method, nullptr, WTFMove(closure), G_TYPE_NONE, { propertyType }));
         GRefPtr<JSCValue> function = jscContextGetOrCreateValue(priv->context.get(), functionObject);
@@ -1054,7 +1054,7 @@ JSCValue* jsc_value_new_function(JSCContext* context, const char* name, GCallbac
     }
     va_end(args);
 
-    GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(destroyNotify)));
+    GRefPtr<GClosure> closure = adoptGRef(g_cclosure_new(callback, userData, reinterpret_cast<GClosureNotify>(reinterpret_cast<GCallback>(destroyNotify))));
     JSC::ExecState* exec = toJS(jscContextGetJSContext(context));
     JSC::VM& vm = exec->vm();
     JSC::JSLockHolder locker(vm);
index 3ff6dfe..cfcda97 100644 (file)
@@ -1188,6 +1188,9 @@ if (COMPILER_IS_GCC_OR_CLANG)
     # Avoid using fused multiply-add instructions since this could give different results
     # for e.g. parseInt depending on the platform and compilation flags.
     WEBKIT_ADD_TARGET_CXX_FLAGS(JavaScriptCore -ffp-contract=off)
+
+    # Avoid "variable tracking size limit exceeded"
+    set_source_files_properties(builtins/BuiltinNames.cpp PROPERTIES COMPILE_FLAGS -fno-var-tracking-assignments)
 endif ()
 
 WEBKIT_MAKE_FORWARDING_HEADERS(JavaScriptCore
index dd1a596..660c692 100644 (file)
@@ -1,3 +1,41 @@
+2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE] Build cleanly with GCC 8 and ICU 60
+        https://bugs.webkit.org/show_bug.cgi?id=185462
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * API/glib/JSCClass.cpp: Silence many -Wcast-function-type warnings.
+        (jsc_class_add_constructor):
+        (jsc_class_add_method):
+        * API/glib/JSCValue.cpp: Silence many -Wcast-function-type warnings.
+        (jsc_value_object_define_property_accessor):
+        (jsc_value_new_function):
+        * CMakeLists.txt: Build BuiltinNames.cpp with -fno-var-tracking-assignments. This was a
+        problem with GCC 7 too, but might as well fix it now.
+        * assembler/ProbeContext.h:
+        (JSC::Probe::CPUState::gpr const): Silence a -Wclass-memaccess warning.
+        (JSC::Probe::CPUState::spr const): Ditto. Assume std::remove_const is safe to clobber.
+        * b3/air/AirArg.h:
+        (JSC::B3::Air::Arg::isRepresentableAs): Silence -Wfallthrough warning.
+        * builtins/BuiltinNames.cpp:
+        (JSC::BuiltinNames::BuiltinNames): Moved from BuiltinNames.h so we can use a special flag.
+        * builtins/BuiltinNames.h:
+        (JSC::BuiltinNames::BuiltinNames): Moved to BuiltinNames.cpp.
+        * dfg/DFGDoubleFormatState.h:
+        (JSC::DFG::mergeDoubleFormatStates): Silence -Wfallthrough warnings.
+        * heap/MarkedBlockInlines.h:
+        (JSC::MarkedBlock::Handle::finishSweepKnowingHeapCellType): Silence -Wfallthrough warnings.
+        * runtime/ConfigFile.cpp:
+        (JSC::ConfigFile::canonicalizePaths): Here GCC found a genuine mistake, strncat is called
+        with the wrong length parameter and the result is not null-terminated. Also, silence a
+        -Wstringop-truncation warning as we intentionally truncate filenames that exceed PATH_MAX.
+        * runtime/IntlDateTimeFormat.cpp:
+        (JSC::IntlDateTimeFormat::partTypeString): Avoid an ICU deprecation warning.
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::init): We were unconditionally running some BigInt code by accident.
+        (JSC::JSGlobalObject::visitChildren): Probably a serious bug? Fixed.
+
 2018-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [ARMv7] Drop ARMv7 disassembler in favor of capstone
index 3941a89..932eae2 100644 (file)
@@ -85,7 +85,7 @@ T CPUState::gpr(RegisterID id) const
     CPUState* cpu = const_cast<CPUState*>(this);
     auto& from = cpu->gpr(id);
     typename std::remove_const<T>::type to { };
-    std::memcpy(&to, &from, sizeof(to)); // Use std::memcpy to avoid strict aliasing issues.
+    std::memcpy(static_cast<void*>(&to), &from, sizeof(to)); // Use std::memcpy to avoid strict aliasing issues.
     return to;
 }
 
@@ -95,7 +95,7 @@ T CPUState::spr(SPRegisterID id) const
     CPUState* cpu = const_cast<CPUState*>(this);
     auto& from = cpu->spr(id);
     typename std::remove_const<T>::type to { };
-    std::memcpy(&to, &from, sizeof(to)); // Use std::memcpy to avoid strict aliasing issues.
+    std::memcpy(static_cast<void*>(&to), &from, sizeof(to)); // Use std::memcpy to avoid strict aliasing issues.
     return to;
 }
 
index 7a38d10..838fca8 100644 (file)
@@ -889,6 +889,7 @@ public:
             case Width64:
                 return B3::isRepresentableAs<int64_t>(value);
             }
+            RELEASE_ASSERT_NOT_REACHED();
         case Unsigned:
             switch (width) {
             case Width8:
@@ -901,7 +902,7 @@ public:
                 return B3::isRepresentableAs<uint64_t>(value);
             }
         }
-        ASSERT_NOT_REACHED();
+        RELEASE_ASSERT_NOT_REACHED();
     }
 
     bool isRepresentableAs(Width, Signedness) const;
@@ -920,6 +921,7 @@ public:
             case Width64:
                 return static_cast<int64_t>(value);
             }
+            RELEASE_ASSERT_NOT_REACHED();
         case Unsigned:
             switch (width) {
             case Width8:
@@ -932,7 +934,7 @@ public:
                 return static_cast<uint64_t>(value);
             }
         }
-        ASSERT_NOT_REACHED();
+        RELEASE_ASSERT_NOT_REACHED();
     }
 
     template<typename T>
index f52e9b8..45de82e 100644 (file)
@@ -47,6 +47,27 @@ SymbolImpl::StaticSymbolImpl dollarVMPrivateName { "PrivateSymbol.$vm", SymbolIm
 SymbolImpl::StaticSymbolImpl polyProtoPrivateName { "PrivateSymbol.PolyProto", SymbolImpl::s_flagIsPrivate };
 
 } // namespace Symbols
+
+// We treat the dollarVM name as a special case below for $vm (because CommonIdentifiers does not
+// yet support the $ character).
+BuiltinNames::BuiltinNames(VM* vm, CommonIdentifiers* commonIdentifiers)
+    : m_emptyIdentifier(commonIdentifiers->emptyIdentifier)
+    JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES_IN_JSC)
+    JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_BUILTIN_NAMES_IN_JSC)
+    JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_BUILTIN_SYMBOLS)
+    , m_dollarVMName(Identifier::fromString(vm, "$vm"))
+    , m_dollarVMPrivateName(Identifier::fromUid(vm, &static_cast<SymbolImpl&>(Symbols::dollarVMPrivateName)))
+    , m_polyProtoPrivateName(Identifier::fromUid(vm, &static_cast<SymbolImpl&>(Symbols::polyProtoPrivateName)))
+{
+    JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY)
+    JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY)
+    JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY)
+    JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY)
+    JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY)
+    m_privateToPublicMap.add(m_dollarVMPrivateName.impl(), &m_dollarVMName);
+    m_publicToPrivateMap.add(m_dollarVMName.impl(), &m_dollarVMPrivateName);
+}
+
 } // namespace JSC
 
 #if COMPILER(MSVC)
index d4f364a..f66b8cb 100644 (file)
@@ -219,26 +219,7 @@ class BuiltinNames {
     WTF_MAKE_NONCOPYABLE(BuiltinNames); WTF_MAKE_FAST_ALLOCATED;
     
 public:
-    // We treat the dollarVM name as a special case below for $vm (because CommonIdentifiers does not
-    // yet support the $ character).
-
-    BuiltinNames(VM* vm, CommonIdentifiers* commonIdentifiers)
-        : m_emptyIdentifier(commonIdentifiers->emptyIdentifier)
-        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES_IN_JSC)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_BUILTIN_NAMES_IN_JSC)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_BUILTIN_SYMBOLS)
-        , m_dollarVMName(Identifier::fromString(vm, "$vm"))
-        , m_dollarVMPrivateName(Identifier::fromUid(vm, &static_cast<SymbolImpl&>(Symbols::dollarVMPrivateName)))
-        , m_polyProtoPrivateName(Identifier::fromUid(vm, &static_cast<SymbolImpl&>(Symbols::polyProtoPrivateName)))
-    {
-        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PRIVATE_TO_PUBLIC_ENTRY)
-        JSC_FOREACH_BUILTIN_FUNCTION_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_PROPERTY_NAME(INITIALIZE_PUBLIC_TO_PRIVATE_ENTRY)
-        JSC_COMMON_PRIVATE_IDENTIFIERS_EACH_WELL_KNOWN_SYMBOL(INITIALIZE_SYMBOL_PUBLIC_TO_PRIVATE_ENTRY)
-        m_privateToPublicMap.add(m_dollarVMPrivateName.impl(), &m_dollarVMName);
-        m_publicToPrivateMap.add(m_dollarVMName.impl(), &m_dollarVMPrivateName);
-    }
+    BuiltinNames(VM*, CommonIdentifiers*);
 
     const Identifier* lookUpPrivateName(const Identifier&) const;
     const Identifier& lookUpPublicName(const Identifier&) const;
index be935a0..dcb2b8c 100644 (file)
@@ -48,6 +48,7 @@ inline DoubleFormatState mergeDoubleFormatStates(DoubleFormatState a, DoubleForm
         case CantUseDoubleFormat:
             return CantUseDoubleFormat;
         }
+        RELEASE_ASSERT_NOT_REACHED();
     case NotUsingDoubleFormat:
         switch (b) {
         case EmptyDoubleFormatState:
@@ -57,6 +58,7 @@ inline DoubleFormatState mergeDoubleFormatStates(DoubleFormatState a, DoubleForm
         case CantUseDoubleFormat:
             return CantUseDoubleFormat;
         }
+        RELEASE_ASSERT_NOT_REACHED();
     case CantUseDoubleFormat:
         return CantUseDoubleFormat;
     }
index e330da2..85c4c19 100644 (file)
@@ -388,6 +388,7 @@ void MarkedBlock::Handle::finishSweepKnowingHeapCellType(FreeList* freeList, con
                     specializedSweep<true, IsEmpty, SweepOnly, BlockHasDestructors, DontScribble, DoesNotHaveNewlyAllocated, MarksStale>(freeList, IsEmpty, SweepOnly, BlockHasDestructors, DontScribble, DoesNotHaveNewlyAllocated, MarksStale, destroyFunc);
                     return true;
                 }
+                RELEASE_ASSERT_NOT_REACHED();
             case SweepToFreeList:
                 switch (marksMode) {
                 case MarksNotStale:
@@ -398,6 +399,7 @@ void MarkedBlock::Handle::finishSweepKnowingHeapCellType(FreeList* freeList, con
                     return true;
                 }
             }
+            RELEASE_ASSERT_NOT_REACHED();
         case NotEmpty:
             switch (sweepMode) {
             case SweepOnly:
@@ -409,6 +411,7 @@ void MarkedBlock::Handle::finishSweepKnowingHeapCellType(FreeList* freeList, con
                     specializedSweep<true, NotEmpty, SweepOnly, BlockHasDestructors, DontScribble, DoesNotHaveNewlyAllocated, MarksStale>(freeList, NotEmpty, SweepOnly, BlockHasDestructors, DontScribble, DoesNotHaveNewlyAllocated, MarksStale, destroyFunc);
                     return true;
                 }
+                RELEASE_ASSERT_NOT_REACHED();
             case SweepToFreeList:
                 switch (marksMode) {
                 case MarksNotStale:
index bb87666..98c196f 100644 (file)
@@ -488,8 +488,19 @@ void ConfigFile::canonicalizePaths()
             bool shouldAddPathSeparator = filenameBuffer[pathnameLength - 1] != '/';
             if (sizeof(filenameBuffer) - 1  >= pathnameLength + shouldAddPathSeparator) {
                 if (shouldAddPathSeparator)
-                    strncat(filenameBuffer, "/", 1);
+                    strncat(filenameBuffer, "/", 2); // Room for '/' plus NUL
+#if COMPILER(GCC)
+#if GCC_VERSION_AT_LEAST(8, 0, 0)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wstringop-truncation"
+#endif
+#endif
                 strncat(filenameBuffer, m_filename, sizeof(filenameBuffer) - strlen(filenameBuffer) - 1);
+#if COMPILER(GCC)
+#if GCC_VERSION_AT_LEAST(8, 0, 0)
+#pragma GCC diagnostic pop
+#endif
+#endif
                 strncpy(m_filename, filenameBuffer, s_maxPathLength);
                 m_filename[s_maxPathLength] = '\0';
             }
index 381ebab..1573c72 100644 (file)
@@ -964,7 +964,7 @@ const char* IntlDateTimeFormat::partTypeString(UDateFormatField field)
     case UDAT_STANDALONE_QUARTER_FIELD:
     case UDAT_RELATED_YEAR_FIELD:
     case UDAT_TIME_SEPARATOR_FIELD:
-#if U_ICU_VERSION_MAJOR_NUM < 58
+#if U_ICU_VERSION_MAJOR_NUM < 58 || !defined(U_HIDE_DEPRECATED_API)
     case UDAT_FIELD_COUNT:
 #endif
         return "literal";
index e1398e2..69b537e 100644 (file)
@@ -627,9 +627,10 @@ void JSGlobalObject::init(VM& vm)
     m_generatorPrototype.set(vm, this, GeneratorPrototype::create(vm, this, GeneratorPrototype::createStructure(vm, this, m_iteratorPrototype.get())));
     m_asyncGeneratorPrototype.set(vm, this, AsyncGeneratorPrototype::create(vm, this, AsyncGeneratorPrototype::createStructure(vm, this, m_asyncIteratorPrototype.get())));
 
-#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
-m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_ ## prototypeBase ## Prototype.get()))); \
-m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get()));
+#define CREATE_PROTOTYPE_FOR_SIMPLE_TYPE(capitalName, lowerName, properName, instanceType, jsName, prototypeBase) do { \
+        m_ ## lowerName ## Prototype.set(vm, this, capitalName##Prototype::create(vm, this, capitalName##Prototype::createStructure(vm, this, m_ ## prototypeBase ## Prototype.get()))); \
+        m_ ## properName ## Structure.set(vm, this, instanceType::createStructure(vm, this, m_ ## lowerName ## Prototype.get())); \
+    } while (0);
     
     FOR_EACH_SIMPLE_BUILTIN_TYPE(CREATE_PROTOTYPE_FOR_SIMPLE_TYPE)
 
@@ -1437,9 +1438,10 @@ void JSGlobalObject::visitChildren(JSCell* cell, SlotVisitor& visitor)
     visitor.append(thisObject->m_sharedArrayBufferStructure);
 #endif
 
-#define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) \
-    visitor.append(thisObject->m_ ## lowerName ## Prototype); \
-    visitor.append(thisObject->m_ ## properName ## Structure); \
+#define VISIT_SIMPLE_TYPE(CapitalName, lowerName, properName, instanceType, jsName, prototypeBase) do { \
+        visitor.append(thisObject->m_ ## lowerName ## Prototype); \
+        visitor.append(thisObject->m_ ## properName ## Structure); \
+    } while (0);
 
     FOR_EACH_SIMPLE_BUILTIN_TYPE(VISIT_SIMPLE_TYPE)
     if (UNLIKELY(Options::useBigInt()))
index a486798..8548df5 100644 (file)
@@ -1,3 +1,12 @@
+2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE] Build cleanly with GCC 8 and ICU 60
+        https://bugs.webkit.org/show_bug.cgi?id=185462
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * xdgmime/CMakeLists.txt: Silence -Wno-cast-function-type. I'm not fighting xdg-mime.
+
 2018-05-06  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [JSC][GTK][JSCONLY] Use capstone disassembler
index 73fee94..2605e1c 100644 (file)
@@ -21,6 +21,7 @@ add_definitions(-DXDG_PREFIX=_wk_xdg)
 add_library(xdgmime STATIC ${XDGMIME_SOURCES})
 
 if (COMPILER_IS_GCC_OR_CLANG)
-    WEBKIT_ADD_TARGET_C_FLAGS(xdgmime -Wno-sign-compare
+    WEBKIT_ADD_TARGET_C_FLAGS(xdgmime -Wno-cast-function-type
+                                      -Wno-sign-compare
                                       -Wno-unused-parameter)
 endif ()
index a7393e5..09117e0 100644 (file)
@@ -1,3 +1,18 @@
+2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE] Build cleanly with GCC 8 and ICU 60
+        https://bugs.webkit.org/show_bug.cgi?id=185462
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * wtf/HashTable.h:
+        (WTF::HashTableBucketInitializer<true>::initialize): Since -Wclass-memaccess warning. This
+        is probably safe enough, since it's for an empty bucket.
+        * wtf/StdLibExtras.h:
+        (WTF::bitwise_cast): Silence -Wclass-memaccess as we use type traits to ensure safety here.
+        * wtf/Vector.h: Ditto, all uses are safe.
+        * wtf/glib/WTFGType.h: Silence -Wcast-function-type.
+
 2018-05-09  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [ARMv7] Drop ARMv7 disassembler in favor of capstone
index 022e281..e6a950f 100644 (file)
@@ -847,7 +847,7 @@ namespace WTF {
             // This initializes the bucket without copying the empty value.
             // That makes it possible to use this with types that don't support copying.
             // The memset to 0 looks like a slow operation but is optimized by the compilers.
-            memset(std::addressof(bucket), 0, sizeof(bucket));
+            memset(static_cast<void*>(std::addressof(bucket)), 0, sizeof(bucket));
         }
     };
     
index 49f2e29..765f432 100644 (file)
@@ -142,7 +142,7 @@ inline ToType bitwise_cast(FromType from)
     static_assert(__is_trivially_copyable(FromType), "bitwise_cast of non-trivially-copyable type!");
 #endif
     typename std::remove_const<ToType>::type to { };
-    std::memcpy(&to, &from, sizeof(to));
+    std::memcpy(static_cast<void*>(&to), static_cast<void*>(&from), sizeof(to));
     return to;
 }
 
index cfcb6bb..80ee20b 100644 (file)
@@ -96,7 +96,7 @@ struct VectorInitializer<true, true, T>
 {
     static void initializeIfNonPOD(T* begin, T* end)
     {
-        memset(begin, 0, reinterpret_cast<char*>(end) - reinterpret_cast<char*>(begin));
+        memset(static_cast<void*>(begin), 0, reinterpret_cast<char*>(end) - reinterpret_cast<char*>(begin));
     }
 
     static void initialize(T* begin, T* end)
@@ -141,11 +141,11 @@ struct VectorMover<true, T>
 {
     static void move(const T* src, const T* srcEnd, T* dst) 
     {
-        memcpy(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
+        memcpy(static_cast<void*>(dst), static_cast<void*>(const_cast<T*>(src)), reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
     }
     static void moveOverlapping(const T* src, const T* srcEnd, T* dst) 
     {
-        memmove(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
+        memmove(static_cast<void*>(dst), static_cast<void*>(const_cast<T*>(src)), reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
     }
 };
 
@@ -171,7 +171,7 @@ struct VectorCopier<true, T>
 {
     static void uninitializedCopy(const T* src, const T* srcEnd, T* dst)
     {
-        memcpy(dst, src, reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
+        memcpy(static_cast<void*>(dst), static_cast<void*>(const_cast<T*>(src)), reinterpret_cast<const char*>(srcEnd) - reinterpret_cast<const char*>(src));
     }
     template<typename U>
     static void uninitializedCopy(const T* src, const T* srcEnd, U* dst)
index 7b733b5..7f1cf4d 100644 (file)
@@ -54,7 +54,7 @@ static void type_name##_finalize(GObject* object) \
     G_OBJECT_CLASS(type_name##_parent_class)->finalize(object); \
 } \
 \
-static void type_name##_class_intern_init(gpointer klass) \
+static void type_name##_class_intern_init(gpointer klass, gpointer) \
 { \
     GObjectClass* gObjectClass = G_OBJECT_CLASS(klass); \
     g_type_class_add_private(klass, sizeof(TypeName##Private)); \
@@ -63,7 +63,7 @@ static void type_name##_class_intern_init(gpointer klass) \
     gObjectClass->finalize = type_name##_finalize; \
 } \
 \
-static void type_name##_init(TypeName* self) \
+static void type_name##_init(TypeName* self, gpointer) \
 { \
     TypeName##Private* priv = G_TYPE_INSTANCE_GET_PRIVATE(self, type_name##_get_type(), TypeName##Private); \
     self->priv = priv; \
index 567ff9f..d75521a 100644 (file)
@@ -1,3 +1,44 @@
+2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE] Build cleanly with GCC 8 and ICU 60
+        https://bugs.webkit.org/show_bug.cgi?id=185462
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * PlatformGTK.cmake: Include directories are in the wrong place.
+        * accessibility/AXObjectCache.cpp: Silence -Wclass-memaccess problems and leave warnings.
+        (WebCore::AXObjectCache::startOrEndTextMarkerDataForRange):
+        (WebCore::AXObjectCache::textMarkerDataForCharacterOffset):
+        (WebCore::AXObjectCache::textMarkerDataForVisiblePosition):
+        (WebCore::AXObjectCache::textMarkerDataForFirstPositionInTextControl):
+        * css/CSSFontFace.cpp: Silence -Wfallthrough
+        (WebCore::CSSFontFace::fontLoadTiming const):
+        * css/CSSSelectorList.cpp: Silence -Wclass-memaccess, this one is intentional.
+        (WebCore::CSSSelectorList::adoptSelectorVector):
+        * editing/TextIterator.cpp: Silence ICU deprecation warnings.
+        * platform/Length.h:
+        (WebCore::Length::operator=): More -Wclass-memaccess, looks benign.
+        * platform/graphics/Gradient.cpp:
+        (WebCore::Gradient::hash const): -Wclass-memaccess again. Leave a warning.
+        * platform/graphics/SurrogatePairAwareTextIterator.cpp: Silence ICU deprecation warnings.
+        * platform/graphics/cairo/FontCairoHarfbuzzNG.cpp:
+        (WebCore::FontCascade::fontForCombiningCharacterSequence const): Silence ICU deprecation.
+        * platform/graphics/freetype/FontCustomPlatformDataFreeType.cpp:
+        (WebCore::FontCustomPlatformData::FontCustomPlatformData): Silence -Wcast-function-type.
+        * platform/graphics/freetype/SimpleFontDataFreeType.cpp:
+        (WebCore::Font::canRenderCombiningCharacterSequence const): Silence ICU deprecation.
+        * platform/graphics/gstreamer/GstAllocatorFastMalloc.cpp:
+        (gstAllocatorFastMallocMemUnmap): Fix -Wcast-function-type.
+        * platform/graphics/gstreamer/MediaPlayerPrivateGStreamer.cpp:
+        (WebCore::MediaPlayerPrivateGStreamer::updateTracks): Fix bad printf.
+        (WebCore::MediaPlayerPrivateGStreamer::enableTrack): Another bad printf.
+        (WebCore::findHLSQueue): Fix -Wcast-function-type.
+        * platform/graphics/gstreamer/eme/WebKitClearKeyDecryptorGStreamer.cpp:
+        (webKitMediaClearKeyDecryptorDecrypt): Fix another bad printf.
+        * platform/network/soup/SocketStreamHandleImplSoup.cpp: Silence -Wcast-function-type.
+        (WebCore::SocketStreamHandleImpl::beginWaitingForSocketWritability):
+        * platform/text/TextEncoding.cpp: Silence ICU deprecration.
+
 2018-05-08  Simon Fraser  <simon.fraser@apple.com>
 
         SVG lighting colors need to be converted into linearSRGB
index a6f77f7..823c77d 100644 (file)
@@ -156,11 +156,11 @@ if (ENABLE_PLUGIN_PROCESS_GTK2)
     )
     target_include_directories(WebCorePlatformGTK2 PRIVATE
         ${WebCore_INCLUDE_DIRECTORIES}
-        ${GTK2_INCLUDE_DIRS}
-        ${GDK2_INCLUDE_DIRS}
     )
     target_include_directories(WebCorePlatformGTK2 SYSTEM PRIVATE
         ${WebCore_SYSTEM_INCLUDE_DIRECTORIES}
+        ${GTK2_INCLUDE_DIRS}
+        ${GDK2_INCLUDE_DIRS}
     )
     target_link_libraries(WebCorePlatformGTK2
          ${WebCore_LIBRARIES}
index 3998f31..31b8a2b 100644 (file)
@@ -1961,7 +1961,9 @@ CharacterOffset AXObjectCache::startOrEndCharacterOffsetForRange(RefPtr<Range> r
 
 void AXObjectCache::startOrEndTextMarkerDataForRange(TextMarkerData& textMarkerData, RefPtr<Range> range, bool isStart)
 {
-    memset(&textMarkerData, 0, sizeof(TextMarkerData));
+    // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence.
+    // Warning: This is risky and bad because TextMarkerData is a nontrivial type.
+    memset(static_cast<void*>(&textMarkerData), 0, sizeof(TextMarkerData));
     
     CharacterOffset characterOffset = startOrEndCharacterOffsetForRange(range, isStart);
     if (characterOffset.isNull())
@@ -2018,7 +2020,10 @@ CharacterOffset AXObjectCache::characterOffsetForNodeAndOffset(Node& node, int o
 
 void AXObjectCache::textMarkerDataForCharacterOffset(TextMarkerData& textMarkerData, const CharacterOffset& characterOffset)
 {
-    memset(&textMarkerData, 0, sizeof(TextMarkerData));
+    // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence.
+    // Warning: This is risky and bad because TextMarkerData is a nontrivial type.
+    memset(static_cast<void*>(&textMarkerData), 0, sizeof(TextMarkerData));
+
     setTextMarkerDataWithCharacterOffset(textMarkerData, characterOffset);
 }
 
@@ -2198,8 +2203,9 @@ std::optional<TextMarkerData> AXObjectCache::textMarkerDataForVisiblePosition(co
     RefPtr<AccessibilityObject> obj = cache->getOrCreate(domNode);
 
     // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence.
+    // Warning: This is risky and bad because TextMarkerData is a nontrivial type.
     TextMarkerData textMarkerData;
-    memset(&textMarkerData, 0, sizeof(TextMarkerData));
+    memset(static_cast<void*>(&textMarkerData), 0, sizeof(TextMarkerData));
     
     textMarkerData.axID = obj.get()->axObjectID();
     textMarkerData.node = domNode;
@@ -2226,8 +2232,9 @@ std::optional<TextMarkerData> AXObjectCache::textMarkerDataForFirstPositionInTex
         return std::nullopt;
 
     // This memory must be zero'd so instances of TextMarkerData can be tested for byte-equivalence.
+    // Warning: This is risky and bad because TextMarkerData is a nontrivial type.
     TextMarkerData textMarkerData;
-    memset(&textMarkerData, 0, sizeof(TextMarkerData));
+    memset(static_cast<void*>(&textMarkerData), 0, sizeof(TextMarkerData));
     
     textMarkerData.axID = obj.get()->axObjectID();
     textMarkerData.node = &textControl;
index 482c0c0..90a1808 100644 (file)
@@ -605,6 +605,7 @@ auto CSSFontFace::fontLoadTiming() const -> FontLoadTiming
         case FontLoadingBehavior::Optional:
             return { 0.1_s, 0_s };
         }
+        RELEASE_ASSERT_NOT_REACHED();
     case Settings::FontLoadTimingOverride::Block:
         return { Seconds::infinity(), 0_s };
     case Settings::FontLoadTimingOverride::Swap:
@@ -612,8 +613,7 @@ auto CSSFontFace::fontLoadTiming() const -> FontLoadTiming
     case Settings::FontLoadTimingOverride::Failure:
         return { 0_s, 0_s };
     }
-    ASSERT_NOT_REACHED();
-    return { 3_s, Seconds::infinity() };
+    RELEASE_ASSERT_NOT_REACHED();
 }
 
 void CSSFontFace::setStatus(Status newStatus)
index 57efa67..4fc6983 100644 (file)
@@ -67,7 +67,7 @@ void CSSSelectorList::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelect
             {
                 // Move item from the parser selector vector into m_selectorArray without invoking destructor (Ugh.)
                 CSSSelector* currentSelector = current->releaseSelector().release();
-                memcpy(&m_selectorArray[arrayIndex], currentSelector, sizeof(CSSSelector));
+                memcpy(static_cast<void*>(&m_selectorArray[arrayIndex]), static_cast<void*>(currentSelector), sizeof(CSSSelector));
 
                 // Free the underlying memory without invoking the destructor.
                 operator delete (currentSelector);
index 6574f1e..4b22a50 100644 (file)
@@ -1999,11 +1999,11 @@ static inline bool containsKanaLetters(const String& pattern)
     return false;
 }
 
-#if COMPILER(CLANG)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
-// NOTE: ICU's unorm_normalize function is deprecated in some SDKs.
+// NOTE: ICU's unorm_normalize function is deprecated.
 
 static void normalizeCharacters(const UChar* characters, unsigned length, Vector<UChar>& buffer)
 {
@@ -2026,8 +2026,8 @@ static void normalizeCharacters(const UChar* characters, unsigned length, Vector
     ASSERT(status == U_STRING_NOT_TERMINATED_WARNING);
 }
 
-#if COMPILER(CLANG)
-#pragma clang diagnostic pop
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic pop
 #endif
 
 static bool isNonLatin1Separator(UChar32 character)
index 64a08e8..bf14421 100644 (file)
@@ -196,7 +196,7 @@ inline Length& Length::operator=(const Length& other)
     if (isCalculated())
         deref();
 
-    memcpy(this, &other, sizeof(Length));
+    memcpy(static_cast<void*>(this), static_cast<void*>(const_cast<Length*>(&other)), sizeof(Length));
     return *this;
 }
 
@@ -208,7 +208,7 @@ inline Length& Length::operator=(Length&& other)
     if (isCalculated())
         deref();
 
-    memcpy(this, &other, sizeof(Length));
+    memcpy(static_cast<void*>(this), static_cast<void*>(&other), sizeof(Length));
     other.m_type = Auto;
     return *this;
 }
index e7f8c67..8994c02 100644 (file)
@@ -213,7 +213,8 @@ unsigned Gradient::hash() const
     COMPILE_ASSERT(!(sizeof(ColorStop) % 2), Color_stop_size_should_be_multiple_of_two);
     
     // Ensure that any padding in the struct is zero-filled, so it will not affect the hash value.
-    memset(&parameters, 0, sizeof(parameters));
+    // FIXME: This is asking for trouble, because it is a nontrivial type.
+    memset(static_cast<void*>(&parameters), 0, sizeof(parameters));
     
     WTF::switchOn(m_data,
         [&parameters] (const LinearData& data) {
index 3aae7ed..4d5d808 100644 (file)
@@ -69,11 +69,11 @@ bool SurrogatePairAwareTextIterator::consumeSlowCase(UChar32& character, unsigne
     return true;
 }
 
-#if COMPILER(CLANG)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
-// NOTE: ICU's unorm_normalize function is deprecated in some SDKs.
+// NOTE: ICU's unorm_normalize function is deprecated.
 
 UChar32 SurrogatePairAwareTextIterator::normalizeVoicingMarks()
 {
@@ -95,8 +95,8 @@ UChar32 SurrogatePairAwareTextIterator::normalizeVoicingMarks()
     return 0;
 }
 
-#if COMPILER(CLANG)
-#pragma clang diagnostic pop
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic pop
 #endif
 
 }
index a8a78c7..ef843a0 100644 (file)
@@ -49,7 +49,14 @@ const Font* FontCascade::fontForCombiningCharacterSequence(const UChar* characte
 {
     UErrorCode error = U_ZERO_ERROR;
     Vector<UChar, 4> normalizedCharacters(length);
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
     int32_t normalizedLength = unorm_normalize(characters, length, UNORM_NFC, UNORM_UNICODE_3_2, normalizedCharacters.data(), length, &error);
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic pop
+#endif
     if (U_FAILURE(error))
         return nullptr;
 
index d3fc934..bd9cd00 100644 (file)
@@ -48,7 +48,7 @@ FontCustomPlatformData::FontCustomPlatformData(FT_Face freeTypeFace, SharedBuffe
     // this cairo_font_face_t is destroyed, it cleans up the FreeType face as well.
     static cairo_user_data_key_t freeTypeFaceKey;
     cairo_font_face_set_user_data(m_fontFace, &freeTypeFaceKey, freeTypeFace,
-         reinterpret_cast<cairo_destroy_func_t>(FT_Done_Face));
+        reinterpret_cast<cairo_destroy_func_t>(reinterpret_cast<GCallback>(FT_Done_Face)));
 }
 
 FontCustomPlatformData::~FontCustomPlatformData()
index 6a0c321..e38290b 100644 (file)
@@ -199,7 +199,14 @@ bool Font::canRenderCombiningCharacterSequence(const UChar* characters, size_t l
 
     UErrorCode error = U_ZERO_ERROR;
     Vector<UChar, 4> normalizedCharacters(length);
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+#endif
     int32_t normalizedLength = unorm_normalize(characters, length, UNORM_NFC, UNORM_UNICODE_3_2, &normalizedCharacters[0], length, &error);
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic pop
+#endif
     if (U_FAILURE(error))
         return false;
 
index 6bca2c9..a3f4d3e 100644 (file)
@@ -86,9 +86,8 @@ static gpointer gstAllocatorFastMallocMemMap(GstMemoryFastMalloc* memory, gsize,
     return memory->data;
 }
 
-static gboolean gstAllocatorFastMallocMemUnmap(GstMemoryFastMalloc*)
+static void gstAllocatorFastMallocMemUnmap(GstMemoryFastMalloc*)
 {
-    return TRUE;
 }
 
 static GstMemoryFastMalloc* gstAllocatorFastMallocMemCopy(GstMemoryFastMalloc* memory, gssize offset, gsize size)
index 36a9526..223d43e 100644 (file)
@@ -685,7 +685,7 @@ void MediaPlayerPrivateGStreamer::updateTracks()
             GST_WARNING("Unknown track type found for stream %s", streamId.utf8().data());
     }
 
-    GST_INFO("Media has %u video tracks, %u audio tracks and %u text tracks", validVideoStreams.size(), validAudioStreams.size(), validTextStreams.size());
+    GST_INFO("Media has %zu video tracks, %zu audio tracks and %zu text tracks", validVideoStreams.size(), validAudioStreams.size(), validTextStreams.size());
 
     bool oldHasAudio = m_hasAudio;
     bool oldHasVideo = m_hasVideo;
@@ -749,7 +749,7 @@ void MediaPlayerPrivateGStreamer::enableTrack(TrackPrivateBaseGStreamer::TrackTy
         ASSERT_NOT_REACHED();
     }
 
-    GST_INFO("Enabling %s track with index: %lu", trackTypeAsString, index);
+    GST_INFO("Enabling %s track with index: %u", trackTypeAsString, index);
     // FIXME: Remove isMediaSource() test below when fixing https://bugs.webkit.org/show_bug.cgi?id=182531
     if (m_isLegacyPlaybin || isMediaSource()) {
         GstElement* element = isMediaSource() ? m_source.get() : m_pipeline.get();
@@ -762,7 +762,7 @@ void MediaPlayerPrivateGStreamer::enableTrack(TrackPrivateBaseGStreamer::TrackTy
             String streamId = gst_stream_get_stream_id(stream);
             selectedStreams = g_list_append(selectedStreams, g_strdup(streamId.utf8().data()));
         } else
-            GST_WARNING("%s stream %lu not found", trackTypeAsString, index);
+            GST_WARNING("%s stream %u not found", trackTypeAsString, index);
 
         // TODO: MSE GstStream API support: https://bugs.webkit.org/show_bug.cgi?id=182531
         gst_element_send_event(m_pipeline.get(), gst_event_new_select_streams(selectedStreams));
@@ -1477,8 +1477,9 @@ void MediaPlayerPrivateGStreamer::purgeInvalidTextTracks(Vector<String> validTra
 }
 #endif
 
-static int findHLSQueue(const GValue* item)
+static gint findHLSQueue(gconstpointer a, gconstpointer)
 {
+    GValue* item = static_cast<GValue*>(const_cast<gpointer>(a));
     GstElement* element = GST_ELEMENT(g_value_get_object(item));
     if (g_str_has_prefix(GST_ELEMENT_NAME(element), "queue")) {
         GstElement* parent = GST_ELEMENT(GST_ELEMENT_PARENT(element));
index 638c4c1..8ed570c 100644 (file)
@@ -255,7 +255,7 @@ static gboolean webKitMediaClearKeyDecryptorDecrypt(WebKitMediaCommonEncryptionD
 
     if (!subSampleCount) {
         // Full sample encryption.
-        GST_TRACE_OBJECT(self, "full sample encryption: %d encrypted bytes", map.size);
+        GST_TRACE_OBJECT(self, "full sample encryption: %zu encrypted bytes", map.size);
 
         // Check if the buffer is empty.
         if (map.size) {
index b94ab58..248a421 100644 (file)
@@ -268,7 +268,7 @@ void SocketStreamHandleImpl::beginWaitingForSocketWritability()
 
     m_writeReadySource = adoptGRef(g_pollable_output_stream_create_source(m_outputStream.get(), m_cancellable.get()));
     ref();
-    g_source_set_callback(m_writeReadySource.get(), reinterpret_cast<GSourceFunc>(writeReadyCallback), this, [](gpointer handle) { 
+    g_source_set_callback(m_writeReadySource.get(), reinterpret_cast<GSourceFunc>(reinterpret_cast<GCallback>(writeReadyCallback)), this, [](gpointer handle) {
         static_cast<SocketStreamHandleImpl*>(handle)->deref();
     });
     g_source_attach(m_writeReadySource.get(), g_main_context_get_thread_default());
index 1792f87..4013f37 100644 (file)
@@ -69,11 +69,11 @@ String TextEncoding::decode(const char* data, size_t length, bool stopOnError, b
     return newTextCodec(*this)->decode(data, length, true, stopOnError, sawError);
 }
 
-#if COMPILER(CLANG)
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wdeprecated-declarations"
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
 #endif
-// NOTE: ICU's unorm_quickCheck and unorm_normalize functions are deprecated in some SDKs.
+// NOTE: ICU's unorm_quickCheck and unorm_normalize functions are deprecated.
 
 Vector<uint8_t> TextEncoding::encode(StringView text, UnencodableHandling handling) const
 {
@@ -112,8 +112,8 @@ Vector<uint8_t> TextEncoding::encode(StringView text, UnencodableHandling handli
     return newTextCodec(*this)->encode(StringView { source, sourceLength }, handling);
 }
 
-#if COMPILER(CLANG)
-#pragma clang diagnostic pop
+#if COMPILER(GCC_OR_CLANG)
+#pragma GCC diagnostic pop
 #endif
 
 const char* TextEncoding::domName() const
index 013a18a..1908895 100644 (file)
@@ -1,3 +1,15 @@
+2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE] Build cleanly with GCC 8 and ICU 60
+        https://bugs.webkit.org/show_bug.cgi?id=185462
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * Platform/IPC/glib/GSocketMonitor.cpp:
+        (IPC::GSocketMonitor::start): Silence -Wcast-function-type warning.
+        * Shared/API/glib/WebKitContextMenu.cpp:
+        (webkit_context_menu_new_with_items): Ditto.
+
 2018-05-08  Sihui Liu  <sihui_liu@apple.com>
 
         Adopt new async _savecookies SPI for keeping networking process active during flushing cookies
index d1e4fcc..b052f87 100644 (file)
@@ -51,7 +51,7 @@ void GSocketMonitor::start(GSocket* socket, GIOCondition condition, RunLoop& run
     m_source = adoptGRef(g_socket_create_source(socket, condition, m_cancellable.get()));
     g_source_set_name(m_source.get(), "[WebKit] Socket monitor");
     m_callback = WTFMove(callback);
-    g_source_set_callback(m_source.get(), reinterpret_cast<GSourceFunc>(socketSourceCallback), this, nullptr);
+    g_source_set_callback(m_source.get(), reinterpret_cast<GSourceFunc>(reinterpret_cast<GCallback>(socketSourceCallback)), this, nullptr);
     g_source_set_priority(m_source.get(), RunLoopSourcePriority::RunLoopDispatcher);
     g_source_attach(m_source.get(), runLoop.mainContext());
 }
index 5ca10af..86c9c0b 100644 (file)
@@ -136,7 +136,7 @@ WebKitContextMenu* webkit_context_menu_new()
 WebKitContextMenu* webkit_context_menu_new_with_items(GList* items)
 {
     WebKitContextMenu* menu = webkit_context_menu_new();
-    g_list_foreach(items, reinterpret_cast<GFunc>(g_object_ref_sink), 0);
+    g_list_foreach(items, reinterpret_cast<GFunc>(reinterpret_cast<GCallback>(g_object_ref_sink)), 0);
     menu->priv->items = g_list_copy(items);
 
     return menu;
index 7b3c4ad..d572c49 100644 (file)
@@ -1,3 +1,17 @@
+2018-05-09  Michael Catanzaro  <mcatanzaro@igalia.com>
+
+        [WPE] Build cleanly with GCC 8 and ICU 60
+        https://bugs.webkit.org/show_bug.cgi?id=185462
+
+        Reviewed by Carlos Alberto Lopez Perez.
+
+        * TestWebKitAPI/CMakeLists.txt: Fix weird build failure, we were missing a directory. Not
+        sure why this was never noticed until now or why the bots are OK.
+        * gtk/jhbuild.modules: Add upstream patch to avoid warnings inside G_DEFINE_TYPE.
+        * gtk/patches/glib-cast-function-type.patch: Added.
+        * wpe/jhbuild.modules: Add upstream patch to avoid warnings inside G_DEFINE_TYPE.
+        * wpe/patches/glib-cast-function-type.patch: Added.
+
 2018-05-06  Yusuke Suzuki  <utatane.tea@gmail.com>
 
         [JSC][GTK][JSCONLY] Use capstone disassembler
index eb78e9a..10f8fca 100644 (file)
@@ -178,6 +178,7 @@ include_directories(
     ${WEBKIT_DIR}/Shared/Plugins
     ${WEBKIT_DIR}/UIProcess
     ${WEBKIT_DIR}/UIProcess/API
+    ${WEBKIT_DIR}/UIProcess/API/C
     ${WEBKIT_DIR}/WebProcess/InjectedBundle
     ${WEBKIT_DIR}/WebProcess/InjectedBundle/API/c
 )
index 134c64c..06b3187 100644 (file)
             hash="sha256:bb89e5c5aad33169a8c7f28b45671c7899c12f74caf707737f784d7102758e6c">
       <!-- This patch landed in glib-2-54 branch and will be available in 2.54.3. -->
       <patch file="glib-gtester-do-not-consider-skipped-tests-as-failures.patch" strip="1"/>
+      <patch file="glib-cast-function-type.patch" strip="1"/>
     </branch>
   </autotools>
 
diff --git a/Tools/gtk/patches/glib-cast-function-type.patch b/Tools/gtk/patches/glib-cast-function-type.patch
new file mode 100644 (file)
index 0000000..732877d
--- /dev/null
@@ -0,0 +1,54 @@
+From c1f5e52844c3bf503aca8881b6af68f78f028b4d Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak@v3.sk>
+Date: Wed, 7 Feb 2018 17:27:54 +0000
+Subject: [PATCH] gtype: cast *_init functions to void(*)(void) first
+
+The *_init() functions have prototypes incompatible with *InitFunc types they
+are being cast to. This upsets GCC 8's -Wcast-function-type that's enabled by
+default with -Wextra.
+
+Let's not have the public header files emit a warning and neutralize it by
+doing a void(*)(void) cast first.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=793272
+---
+ gobject/gtype.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gobject/gtype.h b/gobject/gtype.h
+index f771c07..608efb2 100644
+--- a/gobject/gtype.h
++++ b/gobject/gtype.h
+@@ -1790,7 +1790,7 @@ guint     g_type_get_type_registration_serial (void);
+  */
+ #define G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)       { \
+   const GInterfaceInfo g_implement_interface_info = { \
+-    (GInterfaceInitFunc) iface_init, NULL, NULL \
++    (GInterfaceInitFunc)(void (*)(void)) iface_init, NULL, NULL \
+   }; \
+   g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
+ }
+@@ -1974,9 +1974,9 @@ type_name##_get_type (void) \
+         g_type_register_static_simple (TYPE_PARENT, \
+                                        g_intern_static_string (#TypeName), \
+                                        sizeof (TypeName##Class), \
+-                                       (GClassInitFunc) type_name##_class_intern_init, \
++                                       (GClassInitFunc)(void (*)(void)) type_name##_class_intern_init, \
+                                        sizeof (TypeName), \
+-                                       (GInstanceInitFunc) type_name##_init, \
++                                       (GInstanceInitFunc)(void (*)(void)) type_name##_init, \
+                                        (GTypeFlags) flags); \
+       { /* custom code follows */
+ #define _G_DEFINE_TYPE_EXTENDED_END() \
+@@ -2008,7 +2008,7 @@ type_name##_get_type (void) \
+         g_type_register_static_simple (G_TYPE_INTERFACE, \
+                                        g_intern_static_string (#TypeName), \
+                                        sizeof (TypeName##Interface), \
+-                                       (GClassInitFunc)type_name##_default_init, \
++                                       (GClassInitFunc)(GVoidFunc)type_name##_default_init, \
+                                        0, \
+                                        (GInstanceInitFunc)NULL, \
+                                        (GTypeFlags) 0); \
+--
+libgit2 0.27.0
+
index 1090467..85d9145 100644 (file)
@@ -73,6 +73,7 @@
             hash="sha256:963fdc6685dc3da8e5381dfb9f15ca4b5709b28be84d9d05a9bb8e446abac0a8">
       <patch file="gdate-suppress-string-format-literal-warning.patch" strip="1"/>
       <patch file="glib-revert-wakeup-changes.patch" strip="1"/>
+      <patch file="glib-cast-function-type.patch" strip="1"/>
     </branch>
   </autotools>
 
diff --git a/Tools/wpe/patches/glib-cast-function-type.patch b/Tools/wpe/patches/glib-cast-function-type.patch
new file mode 100644 (file)
index 0000000..732877d
--- /dev/null
@@ -0,0 +1,54 @@
+From c1f5e52844c3bf503aca8881b6af68f78f028b4d Mon Sep 17 00:00:00 2001
+From: Lubomir Rintel <lkundrak@v3.sk>
+Date: Wed, 7 Feb 2018 17:27:54 +0000
+Subject: [PATCH] gtype: cast *_init functions to void(*)(void) first
+
+The *_init() functions have prototypes incompatible with *InitFunc types they
+are being cast to. This upsets GCC 8's -Wcast-function-type that's enabled by
+default with -Wextra.
+
+Let's not have the public header files emit a warning and neutralize it by
+doing a void(*)(void) cast first.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=793272
+---
+ gobject/gtype.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/gobject/gtype.h b/gobject/gtype.h
+index f771c07..608efb2 100644
+--- a/gobject/gtype.h
++++ b/gobject/gtype.h
+@@ -1790,7 +1790,7 @@ guint     g_type_get_type_registration_serial (void);
+  */
+ #define G_IMPLEMENT_INTERFACE(TYPE_IFACE, iface_init)       { \
+   const GInterfaceInfo g_implement_interface_info = { \
+-    (GInterfaceInitFunc) iface_init, NULL, NULL \
++    (GInterfaceInitFunc)(void (*)(void)) iface_init, NULL, NULL \
+   }; \
+   g_type_add_interface_static (g_define_type_id, TYPE_IFACE, &g_implement_interface_info); \
+ }
+@@ -1974,9 +1974,9 @@ type_name##_get_type (void) \
+         g_type_register_static_simple (TYPE_PARENT, \
+                                        g_intern_static_string (#TypeName), \
+                                        sizeof (TypeName##Class), \
+-                                       (GClassInitFunc) type_name##_class_intern_init, \
++                                       (GClassInitFunc)(void (*)(void)) type_name##_class_intern_init, \
+                                        sizeof (TypeName), \
+-                                       (GInstanceInitFunc) type_name##_init, \
++                                       (GInstanceInitFunc)(void (*)(void)) type_name##_init, \
+                                        (GTypeFlags) flags); \
+       { /* custom code follows */
+ #define _G_DEFINE_TYPE_EXTENDED_END() \
+@@ -2008,7 +2008,7 @@ type_name##_get_type (void) \
+         g_type_register_static_simple (G_TYPE_INTERFACE, \
+                                        g_intern_static_string (#TypeName), \
+                                        sizeof (TypeName##Interface), \
+-                                       (GClassInitFunc)type_name##_default_init, \
++                                       (GClassInitFunc)(GVoidFunc)type_name##_default_init, \
+                                        0, \
+                                        (GInstanceInitFunc)NULL, \
+                                        (GTypeFlags) 0); \
+--
+libgit2 0.27.0
+