Bug 47799 - [gtk] clang build fails in X11/Intrinsic.h due to String name conflict
Summary: [gtk] clang build fails in X11/Intrinsic.h due to String name conflict
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Plug-ins (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-10-17 23:33 PDT by ojab
Modified: 2011-10-17 00:51 PDT (History)
3 users (show)

See Also:


Attachments
Build fix with the clang compiler (484 bytes, patch)
2011-10-14 06:20 PDT, Koop Mast
no flags Details | Formatted Diff | Diff
Patch with author/changelog (1.09 KB, patch)
2011-10-16 22:49 PDT, ojab
mrobinson: review-
Details | Formatted Diff | Diff
Updated patch (1.05 KB, patch)
2011-10-16 23:45 PDT, ojab
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description ojab 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
Comment 1 Alexey Proskuryakov 2011-04-19 16:14:05 PDT
There have been tons of clang build fixes since last October.
Comment 2 Alexey Proskuryakov 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.
Comment 3 Martin Robinson 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?
Comment 4 ojab 2011-04-27 00:42:42 PDT
Will check after when I'll be able to build WebKit (bug #59585).
Comment 5 ojab 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)
Comment 6 Martin Robinson 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.
Comment 7 ojab 2011-04-27 11:31:47 PDT
Still the same with additional "#undef String".
Comment 8 Aleksander Balicki 2011-09-03 07:30:04 PDT
still the same error message on clang-2.9 here
Comment 9 Aleksander Balicki 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
Comment 10 Koop Mast 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
Comment 11 WebKit Review Bot 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.
Comment 12 Martin Robinson 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
Comment 13 ojab 2011-10-16 22:49:35 PDT
Created attachment 111215 [details]
Patch with author/changelog
Comment 14 Martin Robinson 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.
Comment 15 ojab 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.
Comment 16 WebKit Review Bot 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>
Comment 17 WebKit Review Bot 2011-10-17 00:51:07 PDT
All reviewed patches have been landed.  Closing bug.