<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>101179</bug_id>
          
          <creation_ts>2012-11-04 21:51:35 -0800</creation_ts>
          <short_desc>Build failure with ICU 50 and C++11 because of a different UChar definition</short_desc>
          <delta_ts>2018-05-08 20:27:26 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Arfrever Frehtes Taifersar Arahesis">Arfrever.FTA</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>glenn</cc>
    
    <cc>jshin</cc>
    
    <cc>markus.icu+webkit</cc>
    
    <cc>mcatanzaro</cc>
    
    <cc>msaboff</cc>
    
    <cc>srl295</cc>
    
    <cc>zilla</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>758230</commentid>
    <comment_count>0</comment_count>
    <who name="Arfrever Frehtes Taifersar Arahesis">Arfrever.FTA</who>
    <bug_when>2012-11-04 21:51:35 -0800</bug_when>
    <thetext>When GCC &gt;=4.7 (or another compiler supporting C++11) is used, then UChar type from ICU 50 is a typedef to char16_t instead of unsigned short int. This results in compilation failure in WebKit.

To reproduce this bug, you must:
1. Build ICU 50 using GCC &gt;=4.7. ICU will automatically be built with -std=c++11 flag.
2. Build WebKit with -std=c++11 (or -std=gnu++11) manually added to CXXFLAGS.

Compilation failure does not occur with ICU 49 or older.

Last lines from `make`:

  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSBase.lo
  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSCallbackConstructor.lo
  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSCallbackFunction.lo
  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSCallbackObject.lo
  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSClassRef.lo
  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSContextRef.lo
  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSObjectRef.lo
  CXX      Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSStringRef.lo
Source/JavaScriptCore/API/JSStringRef.cpp: In function ‘OpaqueJSString* JSStringCreateWithCharacters(const JSChar*, size_t)’:
Source/JavaScriptCore/API/JSStringRef.cpp:39:50: error: invalid conversion from ‘const JSChar* {aka const short unsigned int*}’ to ‘const UChar* {aka const char16_t*}’ [-fpermissive]
In file included from Source/JavaScriptCore/API/JSStringRef.cpp:30:0:
Source/JavaScriptCore/API/OpaqueJSString.h:44:39: error:   initializing argument 1 of ‘static WTF::PassRefPtr&lt;OpaqueJSString&gt; OpaqueJSString::create(const UChar*, unsigned int)’ [-fpermissive]
Source/JavaScriptCore/API/JSStringRef.cpp: In function ‘const JSChar* JSStringGetCharactersPtr(JSStringRef)’:
Source/JavaScriptCore/API/JSStringRef.cpp:75:31: error: invalid conversion from ‘UChar* {aka char16_t*}’ to ‘const JSChar* {aka const short unsigned int*}’ [-fpermissive]
make[1]: *** [Source/JavaScriptCore/API/libjavascriptcoregtk_3_0_la-JSStringRef.lo] Error 1</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>758669</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-11-05 10:32:04 -0800</bug_when>
    <thetext>Could you please post a snippet of how exactly ICU 5.0 defines UChar?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>758706</commentid>
    <comment_count>2</comment_count>
    <who name="Jonathan Wakely">zilla</who>
    <bug_when>2012-11-05 11:02:49 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; Could you please post a snippet of how exactly ICU 5.0 defines UChar?

See http://gcc.gnu.org/ml/gcc-help/2012-11/msg00018.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>758731</commentid>
    <comment_count>3</comment_count>
    <who name="Arfrever Frehtes Taifersar Arahesis">Arfrever.FTA</who>
    <bug_when>2012-11-05 11:23:48 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; ICU 5.0

Versioning of ICU has changed since 49:
http://userguide.icu-project.org/design#TOC-ICU-Release-Version-Number-ICU-49-and-later-

(In reply to comment #2)
&gt; See http://gcc.gnu.org/ml/gcc-help/2012-11/msg00018.html

(Undefined references mentioned in that thread will occur when building WebKit with older version of C++11 if ICU has been built with C++11.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>758736</commentid>
    <comment_count>4</comment_count>
    <who name="Arfrever Frehtes Taifersar Arahesis">Arfrever.FTA</who>
    <bug_when>2012-11-05 11:27:33 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; older version of C++11

s/older version of C++11/older version of C++/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759220</commentid>
    <comment_count>5</comment_count>
    <who name="Steven R. Loomis">srl295</who>
    <bug_when>2012-11-05 21:13:29 -0800</bug_when>
    <thetext>Maybe caused by http://bugs.icu-project.org/trac/ticket/9717</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759222</commentid>
    <comment_count>6</comment_count>
    <who name="Steven R. Loomis">srl295</who>
    <bug_when>2012-11-05 21:13:49 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Maybe caused by http://bugs.icu-project.org/trac/ticket/9717


see there for a possible workaround.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>759290</commentid>
    <comment_count>7</comment_count>
    <who name="Arfrever Frehtes Taifersar Arahesis">Arfrever.FTA</who>
    <bug_when>2012-11-05 23:15:51 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Maybe caused by http://bugs.icu-project.org/trac/ticket/9717

This bug in WebKit was caused by solution for ICU ticket 9469. ICU ticket 9717 only suggests temporary workaround (forceful disabling of C++11). The proper solution in WebKit is to add appropriate casts (or use char16_t in more places in WebKit code).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>763137</commentid>
    <comment_count>8</comment_count>
    <who name="Markus Scherer">markus.icu+webkit</who>
    <bug_when>2012-11-09 10:24:26 -0800</bug_when>
    <thetext>In ICU, I just changed UChar to not automatically become char16_t, but users can add something like CPPFLAGS=-DUCHAR_TYPE=char16_t.

See http://bugs.icu-project.org/trac/changeset/32780

If this does not work for WebKit then please reply to http://bugs.icu-project.org/trac/ticket/9728 or on the icu-support mailing list (http://site.icu-project.org/contacts).

Best regards,
markus</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1422128</commentid>
    <comment_count>9</comment_count>
    <who name="Michael Catanzaro">mcatanzaro</who>
    <bug_when>2018-05-08 20:27:26 -0700</bug_when>
    <thetext>Looks like this is obsolete as per comment #8.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>