RESOLVED INVALID 83976
[Qt] Fix the build for GCC 4.7
https://bugs.webkit.org/show_bug.cgi?id=83976
Summary [Qt] Fix the build for GCC 4.7
jingdow
Reported 2012-04-14 04:45:41 PDT
Compilation of qtwebkit (r114202) fails: g++ -c -Wall -Wextra -Wreturn-type -fno-strict-aliasing -Wchar-subscripts -Wformat-security -Wreturn-type -Wno-unused-parameter -Wno-sign-compare -Wno-switch -Wno-switch-enum -Wundef -Wmissing-noreturn -Winit-self -m64 -pipe -Werror -Wno-c++0x-compat -ffunction-sections -fdata-sections -march=k8-sse3 -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2 -pthread -pthread -pthread -pthread -pthread -pthread -pthread -pthread -D_REENTRANT -fPIC -DENABLE_REQUEST_ANIMATION_FRAME=1 -DENABLE_DOWNLOAD_ATTRIBUTE=1 -DENABLE_WEBGL=1 -DENABLE_3D_RENDERING=1 -DENABLE_ACCELERATED_2D_CANVAS=1 -DENABLE_ANIMATION_API=1 -DENABLE_BLOB=1 -DENABLE_SQL_DATABASE=1 -DENABLE_FILTERS=1 -DENABLE_FTPDIR=1 -DENABLE_FULLSCREEN_API=1 -DENABLE_GEOLOCATION=1 -DENABLE_ICONDATABASE=1 -DENABLE_INPUT_SPEECH=1 -DENABLE_INPUT_TYPE_DATE=1 -DENABLE_INPUT_TYPE_DATETIME=1 -DENABLE_INPUT_TYPE_DATETIMELOCAL=1 -DENABLE_INPUT_TYPE_MONTH=1 -DENABLE_INPUT_TYPE_TIME=1 -DENABLE_INPUT_TYPE_WEEK=1 -DENABLE_JAVASCRIPT_DEBUGGER=1 -DENABLE_LINK_PREFETCH=1 -DENABLE_MATHML=1 -DENABLE_MEDIA_SOURCE=1 -DENABLE_METER_TAG=1 -DENABLE_MHTML=1 -DENABLE_MICRODATA=1 -DENABLE_PAGE_VISIBILITY_API=1 -DENABLE_PROGRESS_TAG=1 -DENABLE_SHARED_WORKERS=1 -DENABLE_STYLE_SCOPED=1 -DENABLE_SVG=1 -DENABLE_SVG_DOM_OBJC_BINDINGS=1 -DWTF_USE_TILED_BACKING_STORE=1 -DENABLE_TOUCH_EVENTS=1 -DENABLE_TOUCH_ICON_LOADING=1 -DENABLE_WEB_SOCKETS=1 -DENABLE_WEB_TIMING=1 -DENABLE_WORKERS=1 -DENABLE_XSLT=1 -DWTF_USE_QT4_UNICODE=1 -DENABLE_SVG_FONTS=0 -DHAVE_FONTCONFIG=1 -DENABLE_GAMEPAD=0 -DENABLE_CHANNEL_MESSAGING=1 -DENABLE_DIRECTORY_UPLOAD=0 -DENABLE_FILE_SYSTEM=0 -DENABLE_QUOTA=0 -DENABLE_DASHBOARD_SUPPORT=0 -DENABLE_CSS_FILTERS=1 -DENABLE_SHADOW_DOM=0 -DENABLE_DETAILS=1 -DENABLE_LEGACY_NOTIFICATIONS=1 -DENABLE_NOTIFICATIONS=1 -DENABLE_INPUT_TYPE_COLOR=0 -DENABLE_SCRIPTED_SPEECH=0 -DENABLE_INSPECTOR=1 -DENABLE_WEB_AUDIO=0 -DENABLE_MEDIA_STATISTICS=0 -DENABLE_MEDIA_STREAM=0 -DENABLE_VIDEO_TRACK=0 -DENABLE_TOUCH_ADJUSTMENT=1 -DENABLE_FAST_MOBILE_SCROLLING=1 -DWTF_USE_QT_IMAGE_DECODER=1 -DENABLE_DATALIST=1 -DENABLE_NETSCAPE_PLUGIN_API=1 -DPLUGIN_ARCHITECTURE_UNSUPPORTED=1 -DHAVE_QSTYLE=1 -DENABLE_ORIENTATION_EVENTS=1 -DENABLE_DEVICE_ORIENTATION=1 -DENABLE_GESTURE_EVENTS=1 -DENABLE_VIDEO=1 -DWTF_USE_GSTREAMER=1 -DHAVE_QQUICK1=1 -DQT_MAKEDLL -DBUILDING_QT__=1 -DNDEBUG -DBUILDING_QtWebKit -DBUILDING_WEBKIT -DQT_ASCII_CAST_WARNINGS -DXP_UNIX -DENABLE_NETSCAPE_PLUGIN_METADATA_CACHE=1 -DENABLE_GLIB_SUPPORT=1 -DWTF_USE_TEXTURE_MAPPER=1 -DWTF_USE_TEXTURE_MAPPER_GL=1 -DENABLE_GLIB_SUPPORT=1 -DQT_NO_DEBUG -DQT_SQL_LIB -DQT_XMLPATTERNS_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt/mkspecs/linux-g++-64 -I../../../Source -I/usr/include/QtCore -I/usr/include/QtNetwork -I/usr/include/QtGui -I/usr/include/QtOpenGL -I/usr/include/QtXmlPatterns -I/usr/include/QtSql -I/usr/include -I/usr/include/QtSensors -I/usr/include/QtLocation -I. -I../../../Source/WebKit/qt/Api -I../../../Source/WebKit/qt/WebCoreSupport -I../../../Source/WTF/wtf/qt -I../../../Source -I/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/WebKitBuild/Release/Source/include -I../../../Source/WebCore -I../../../Source/WebCore/Modules/filesystem -I../../../Source/WebCore/Modules/geolocation -I../../../Source/WebCore/Modules/indexeddb -I../../../Source/WebCore/Modules/webaudio -I../../../Source/WebCore/Modules/webdatabase -I../../../Source/WebCore/Modules/websockets -I../../../Source/WebCore/accessibility -I../../../Source/WebCore/bindings -I../../../Source/WebCore/bindings/generic -I../../../Source/WebCore/bridge -I../../../Source/WebCore/bridge/qt -I../../../Source/WebCore/css -I../../../Source/WebCore/dom -I../../../Source/WebCore/dom/default -I../../../Source/WebCore/editing -I../../../Source/WebCore/fileapi -I../../../Source/WebCore/history -I../../../Source/WebCore/html -I../../../Source/WebCore/html/canvas -I../../../Source/WebCore/html/parser -I../../../Source/WebCore/html/shadow -I../../../Source/WebCore/html/track -I../../../Source/WebCore/inspector -I../../../Source/WebCore/loader -I../../../Source/WebCore/loader/appcache -I../../../Source/WebCore/loader/archive -I../../../Source/WebCore/loader/cache -I../../../Source/WebCore/loader/icon -I../../../Source/WebCore/mathml -I../../../Source/WebCore/notifications -I../../../Source/WebCore/page -I../../../Source/WebCore/page/animation -I../../../Source/WebCore/page/qt -I../../../Source/WebCore/page/scrolling -I../../../Source/WebCore/platform -I../../../Source/WebCore/platform/animation -I../../../Source/WebCore/platform/audio -I../../../Source/WebCore/platform/graphics -I../../../Source/WebCore/platform/graphics/filters -I../../../Source/WebCore/platform/graphics/filters/arm -I../../../Source/WebCore/platform/graphics/opengl -I../../../Source/WebCore/platform/graphics/qt -I../../../Source/WebCore/platform/graphics/surfaces -I../../../Source/WebCore/platform/graphics/texmap -I../../../Source/WebCore/platform/graphics/transforms -I../../../Source/WebCore/platform/image-decoders -I../../../Source/WebCore/platform/leveldb -I../../../Source/WebCore/platform/mock -I../../../Source/WebCore/platform/network -I../../../Source/WebCore/platform/network/qt -I../../../Source/WebCore/platform/qt -I../../../Source/WebCore/platform/sql -I../../../Source/WebCore/platform/text -I../../../Source/WebCore/platform/text/transcoder -I../../../Source/WebCore/plugins -I../../../Source/WebCore/rendering -I../../../Source/WebCore/rendering/mathml -I../../../Source/WebCore/rendering/style -I../../../Source/WebCore/rendering/svg -I../../../Source/WebCore/storage -I../../../Source/WebCore/svg -I../../../Source/WebCore/svg/animation -I../../../Source/WebCore/svg/graphics -I../../../Source/WebCore/svg/graphics/filters -I../../../Source/WebCore/svg/properties -I../../../Source/WebCore/testing -I/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/Source/WebCore/websockets -I../../../Source/WebCore/workers -I../../../Source/WebCore/xml -I../../../Source/WebCore/xml/parser -I../../../Source/ThirdParty -I../../../Source/WebCore/bridge/jsc -I../../../Source/WebCore/bindings/js -I/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/Source/WebCore/bindings/js/specialization -I../../../Source/WebCore/bridge/c -I../../../Source/WebCore/testing/js -IWebCore/generated -I../../../Source/WebCore/platform/graphics/gstreamer -I/usr/src/3rdparty/sqlite/ -I../../../Source/JavaScriptCore -I../../../Source -I../../../Source/WTF -I../../../Source/JavaScriptCore/assembler -I../../../Source/JavaScriptCore/bytecode -I../../../Source/JavaScriptCore/bytecompiler -I../../../Source/JavaScriptCore/heap -I../../../Source/JavaScriptCore/dfg -I../../../Source/JavaScriptCore/debugger -I../../../Source/JavaScriptCore/interpreter -I../../../Source/JavaScriptCore/jit -I../../../Source/JavaScriptCore/llint -I../../../Source/JavaScriptCore/parser -I../../../Source/JavaScriptCore/profiler -I../../../Source/JavaScriptCore/runtime -I../../../Source/JavaScriptCore/tools -I../../../Source/JavaScriptCore/yarr -I../../../Source/JavaScriptCore/API -I../../../Source/JavaScriptCore/ForwardingHeaders -IJavaScriptCore/generated -I../../../Source -I../../../Source/WTF -I/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/Source/WTF/gobject -I/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/Source/WTF/qt -I/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/Source/WTF/unicode -I../../../Source/WTF/wtf -I/usr/X11R6/include -I/usr/include -I/usr/include/QtMobility -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/gstreamer-0.10 -I/usr/include/libxml2 -I/usr/X11R6/include -I../../../Source -I. -o obj/release/DeviceMotionProviderQt.o ../../../Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp ../../../Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp: In destructor ‘virtual WebCore::DeviceMotionClientQt::~DeviceMotionClientQt()’: ../../../Source/WebKit/qt/WebCoreSupport/DeviceMotionClientQt.cpp:35:12: грешка: deleting object of polymorphic class type ‘WebCore::DeviceMotionProviderQt’ which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor] cc1plus: all warnings being treated as errors make[3]: *** [obj/release/DeviceMotionClientQt.o] Error 1 make[3]: *** Waiting for unfinished jobs.... ../../../Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp: In destructor ‘WebCore::DeviceMotionProviderQt::~DeviceMotionProviderQt()’: ../../../Source/WebKit/qt/WebCoreSupport/DeviceMotionProviderQt.cpp:39:12: грешка: deleting object of polymorphic class type ‘WebCore::DeviceOrientationProviderQt’ which has non-virtual destructor might cause undefined behaviour [-Werror=delete-non-virtual-dtor] cc1plus: all warnings being treated as errors make[3]: *** [obj/release/DeviceMotionProviderQt.o] Error 1 make[3]: Leaving directory `/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/WebKitBuild/Release/Source' make[2]: *** [sub-api-pri-make_default-ordered] Error 2 make[2]: Leaving directory `/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/WebKitBuild/Release/Source' make[1]: *** [sub-Source-QtWebKit-pro-make_default-ordered] Error 2 make[1]: Leaving directory `/home/mladen/Programi/pkgbuilds/qtwebkit/qtwebkit/src/WebKit-r114202/WebKitBuild/Release' make: *** [incremental] Error 2 gcc version 4.7.0 20120407 Qt compiled with the gcc version stated above.
Attachments
proposed patch (3.63 KB, patch)
2012-04-16 07:26 PDT, Andras Becsi
hausmann: review-
Csaba Osztrogonác
Comment 1 2012-04-16 05:28:18 PDT
note: r114202 is absolutely unrelated change, it isn't the culprit for this build breakage.
Andras Becsi
Comment 2 2012-04-16 07:26:56 PDT
Created attachment 137344 [details] proposed patch
Andras Becsi
Comment 3 2012-04-16 09:54:45 PDT
(In reply to comment #1) > note: r114202 is absolutely unrelated change, it isn't the culprit for this build breakage. That is right. This code is only compiled if qt-mobility is present, that is why it slipped my attention. Thanks for reporting.
Simon Hausmann
Comment 4 2012-04-16 10:46:18 PDT
Comment on attachment 137344 [details] proposed patch I don't think the virtual destructor is required here in WebKit, it seems the bug is actually in qtsensors, which defines a class with virtual methods but not virtual destructor.
Simon Hausmann
Comment 5 2012-04-16 10:50:55 PDT
jingdow
Comment 6 2012-04-16 11:12:59 PDT
I've applied the patch from Comment #2 and successfully compiled.
Andras Becsi
Comment 7 2012-04-16 14:22:16 PDT
(In reply to comment #4) > (From update of attachment 137344 [details]) > I don't think the virtual destructor is required here in WebKit, it seems the bug is actually in qtsensors, which defines a class with virtual methods but not virtual destructor. You are right, this just suppresses the warning. I'm closing this as invalid.
Note You need to log in before you can comment on or make changes to this bug.