[webkit-dev] Compilation errors with ARM RVCT Compiler

Shadakshari Hiremath shaddoo at gmail.com
Fri Sep 5 02:37:20 PDT 2008

Hi Paul,

Thank you very much for your quick response. Based on your suggestion, I had
a relook into the passrefptr.h file. In this file T refers to a
datatype/class which will be supplied during instantiation of the template
in many CPP files and the type is unknown inside the template class. So we
cannot include the definition of all the classes which will be supplied
during instantiation. I am feeling that webkit cannot be compiled with ARM
RVCT compiler due to its limitation. Please suggest if there is any other


2008/9/5 Paul Pedriana <ppedriana at gmail.com>

>  It looks to me like the problem is due to a template implementation not
> being visible to the code being compiled. GCC and VC++ don't enforce the C++
> standard strictly here, and the CodeWarrior and EDG-based compilers
> correctly flag this as invalid code. VC++ compiles templates by essentially
> converting the entire declaration into a macro which gets expanded only at
> the final front-end compilation stage, and thus it doesn't templated code
> until later (which in fact the templated type has become fully visible). GCC
> is somewhat like VC++ but seems to do a certain amount of first-pass
> inspection of the template declaration that catches some misusage within the
> template declaration itself, but it still doesn't check or compile the
> template code upon its usage like CodeWarrior and GCC do. The fix is to make
> the template declaration (as opposed to a forward declaration) fully visible
> at the time of its usage.
> I'm saying this based on experience and not because I have debugged this
> particular problem myself. So it could possibly be a different issue. But
> the error messages below, and the fact that it is occurring with EDG and not
> GCC and VC++, and because it involves templates rings all the bells of this
> problem.
> There is a related C++ problem which is more subtle. Consider this code
> that the compiler sees in the given order:
>     1) Declare template X
>     2) Use template X
>     3) Declare specialization of template X
> Most compilers incorrectly compile the specialization (line 3) into the
> usage at line 2. But the standard requires that the specialization be
> ignored, since it was not visible at the time line 2 was compiled. You can
> see why it is that a compiler which treats templates much like macros will
> get this wrong, as they don't compile line 2 until later and simply apply
> both the 'macros' declared at line 1 and 3.
> Paul
>  Hi Webkit Forum,
> I am getting compilation errors while compiling webcore and javascriptcore
> with ARM RVCT compiler version 2.2 build 559. This is my maiden attempt to
> build webkit with RVCT compiler.
> Three errors are appearing while compiling many source files. I have
> provided Attr.cpp as an example compilation.
> When compiling k:\webkit/webcore/dom/Attr.cpp following 3 errors are
> displayed
> 1) "E:\WebKit\CygWin\home\output\include/JavaScriptCore/PassRefPtr.h", line
> 44: Error:  #393: pointer ptr to incomplete class type is not allowed
> ALWAYS_INLINE ~PassRefPtr() { if (T* ptr = m_ptr) ptr->deref(); }
> ^
> 2) "E:\WebKit\CygWin\home\output\include/JavaScriptCore/ListHashSet.h",
> line 445: Error:  #254: typename is not allowed
>           typename ImplType::iterator it = m_impl.template find<ValueType,
> Translator>(value);
>           ^
> 3) "E:\WebKit\CygWin\home\output\include/JavaScriptCore/RefPtr.h", line 58:
> Error:  #20: identifier "adoptRef" is undefined
>           PassRefPtr<T> release() { PassRefPtr<T> tmp = adoptRef(m_ptr);
> m_ptr = 0; return tmp; }
> ^
> Please help to resolve this problem.
> Regards,
> Shaddu
> ------------------------------
> _______________________________________________
> webkit-dev mailing listwebkit-dev at lists.webkit.orghttp://lists.webkit.org/mailman/listinfo.cgi/webkit-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.webkit.org/pipermail/webkit-dev/attachments/20080905/10c17006/attachment.html 

More information about the webkit-dev mailing list