RESOLVED FIXED 47799
[gtk] clang build fails in X11/Intrinsic.h due to String name conflict
https://bugs.webkit.org/show_bug.cgi?id=47799
Summary [gtk] clang build fails in X11/Intrinsic.h due to String name conflict
ojab
Reported 2010-10-17 23:33:58 PDT
make[1]: Entering directory `/sources/WebKit' CXX WebCore/plugins/gtk/libwebkitgtk_1_0_la-PluginViewGtk.lo In file included from WebCore/plugins/gtk/PluginViewGtk.cpp:69: In file included from WebCore/plugins/gtk/gtk2xtbin.h:44: /usr/include/X11/Intrinsic.h:69:15: error: typedef redefinition with different types ('char *' vs 'WTF::String') typedef char *String; ^ In file included from WebCore/plugins/gtk/PluginViewGtk.cpp:30: In file included from ./WebCore/plugins/PluginView.h:31: In file included from ./WebCore/page/FrameLoadRequest.h:29: In file included from ./WebCore/platform/network/soup/ResourceRequest.h:30: In file included from ./WebCore/platform/network/ResourceRequestBase.h:31: In file included from ./WebCore/platform/network/FormData.h:23: In file included from ./WebCore/platform/KURL.h:29: In file included from ./WebCore/platform/text/PlatformString.h:28: ./JavaScriptCore/wtf/text/WTFString.h:78:7: note: previous definition is here class String { ^ 1 error generated. make[1]: *** [WebCore/plugins/gtk/libwebkitgtk_1_0_la-PluginViewGtk.lo] Error 1
Attachments
Build fix with the clang compiler (484 bytes, patch)
2011-10-14 06:20 PDT, Koop Mast
no flags
Patch with author/changelog (1.09 KB, patch)
2011-10-16 22:49 PDT, ojab
mrobinson: review-
Updated patch (1.05 KB, patch)
2011-10-16 23:45 PDT, ojab
no flags
Alexey Proskuryakov
Comment 1 2011-04-19 16:14:05 PDT
There have been tons of clang build fixes since last October.
Alexey Proskuryakov
Comment 2 2011-04-19 23:43:15 PDT
Sorry, didn't mean to close this bug - this failure is platform specific, and may have not been fixed yet.
Martin Robinson
Comment 3 2011-04-23 19:51:38 PDT
ojab, do you mind moving the gtk2xtbin.h to the top of PluginViewGtk.cpp and see if that fixes the error?
ojab
Comment 4 2011-04-27 00:42:42 PDT
Will check after when I'll be able to build WebKit (bug #59585).
ojab
Comment 5 2011-04-27 11:18:23 PDT
Moving the gtk2xtbin.h to the top of PluginViewGtk.cpp leads to the plenty of errors like ./Source/WebCore/platform/KURL.h:82:44: error: cannot initialize a member subobject of type 'String' (aka 'char *') with an rvalue of type 'WTF::HashTableDeletedValueType' KURL(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { } WebKit r85060, clang version 3.0 (trunk 130277)
Martin Robinson
Comment 6 2011-04-27 11:23:30 PDT
(In reply to comment #5) > Moving the gtk2xtbin.h to the top of PluginViewGtk.cpp leads to the plenty of errors like > > ./Source/WebCore/platform/KURL.h:82:44: error: cannot initialize a member subobject of type 'String' (aka 'char *') > with an rvalue of type 'WTF::HashTableDeletedValueType' > KURL(WTF::HashTableDeletedValueType) : m_string(WTF::HashTableDeletedValue) { } > > > WebKit r85060, clang version 3.0 (trunk 130277) You may need to add "#undef String" right after including gtk2xtbin.h as well.
ojab
Comment 7 2011-04-27 11:31:47 PDT
Still the same with additional "#undef String".
Aleksander Balicki
Comment 8 2011-09-03 07:30:04 PDT
still the same error message on clang-2.9 here
Aleksander Balicki
Comment 9 2011-09-03 11:03:23 PDT
(In reply to comment #0) > make[1]: Entering directory `/sources/WebKit' > CXX WebCore/plugins/gtk/libwebkitgtk_1_0_la-PluginViewGtk.lo > In file included from WebCore/plugins/gtk/PluginViewGtk.cpp:69: > In file included from WebCore/plugins/gtk/gtk2xtbin.h:44: > /usr/include/X11/Intrinsic.h:69:15: error: typedef redefinition with different types ('char *' vs 'WTF::String') > typedef char *String; > ^ > In file included from WebCore/plugins/gtk/PluginViewGtk.cpp:30: > In file included from ./WebCore/plugins/PluginView.h:31: > In file included from ./WebCore/page/FrameLoadRequest.h:29: > In file included from ./WebCore/platform/network/soup/ResourceRequest.h:30: > In file included from ./WebCore/platform/network/ResourceRequestBase.h:31: > In file included from ./WebCore/platform/network/FormData.h:23: > In file included from ./WebCore/platform/KURL.h:29: > In file included from ./WebCore/platform/text/PlatformString.h:28: > ./JavaScriptCore/wtf/text/WTFString.h:78:7: note: previous definition is here > class String { > ^ > 1 error generated. > make[1]: *** [WebCore/plugins/gtk/libwebkitgtk_1_0_la-PluginViewGtk.lo] Error 1 and also the same message under clang current-trunk
Koop Mast
Comment 10 2011-10-14 06:20:35 PDT
Created attachment 111007 [details] Build fix with the clang compiler This patch was submitted in our bug database by Andrei Lavreniyuk <andy.lavr@gmail.com> http://www.freebsd.org/cgi/query-pr.cgi?pr=160538
WebKit Review Bot
Comment 11 2011-10-14 06:29:41 PDT
Attachment 111007 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files']" exit_code: 1 Total errors found: 0 in 0 files If any of these errors are false positives, please file a bug against check-webkit-style.
Martin Robinson
Comment 12 2011-10-14 11:49:31 PDT
(In reply to comment #10) > Created an attachment (id=111007) [details] > Build fix with the clang compiler > > This patch was submitted in our bug database by Andrei Lavreniyuk <andy.lavr@gmail.com> > http://www.freebsd.org/cgi/query-pr.cgi?pr=160538 Do you mind resubmitting this patch with a ChangeLog? You can use prepare-ChangeLog in Tools/Scripts/ to generate it. If you do that I'll be able to land it directly from this bug. For more information see: http://www.webkit.org/coding/contributing.html
ojab
Comment 13 2011-10-16 22:49:35 PDT
Created attachment 111215 [details] Patch with author/changelog
Martin Robinson
Comment 14 2011-10-16 23:37:19 PDT
Comment on attachment 111215 [details] Patch with author/changelog View in context: https://bugs.webkit.org/attachment.cgi?id=111215&action=review Sorry. Should have mentioned the thing below before. Do you mind alos removing the "No new tests" line from the ChangeLog. The commit queue won't land the patch with that there. > Source/WebCore/plugins/gtk/PluginViewGtk.cpp:76 > +#define String XtStringType > #if defined(XP_UNIX) > #include "RefPtrCairo.h" > #include "gtk2xtbin.h" Hrm. I'm guessing this should be inside the #if defined(XP_UNIX) block? > Source/WebCore/plugins/gtk/PluginViewGtk.cpp:86 > +#undef String Same here...shouldn't this be up above? > Source/WebCore/ChangeLog:7 > + No new tests. (OOPS!) Please remove this line.
ojab
Comment 15 2011-10-16 23:45:01 PDT
Created attachment 111218 [details] Updated patch Looks like it really should be inside "#if defined(XP_UNIX)", fixed patch in the attached file.
WebKit Review Bot
Comment 16 2011-10-17 00:51:03 PDT
Comment on attachment 111218 [details] Updated patch Clearing flags on attachment: 111218 Committed r97591: <http://trac.webkit.org/changeset/97591>
WebKit Review Bot
Comment 17 2011-10-17 00:51:07 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.