[ g++ issue ]
g++-4.4 / g++-4.5 doesn't detect following case, but, g++-4.6 does.
< a.cpp > --------- class P { public: void a(); }; class A : public P { public: void p(); }; void P::a() { // 'const' quailifier' is discard here! static_cast<const A*>(this)->p(); } void A::p() { ; } int main() { return 0; } =================== Test ====================== $ g++-4.5 a.cpp <= OK. $ g++-4.6 a.cpp a.cpp: In member function ‘void P::a()’: a.cpp:13:33: error: passing ‘const A’ as ‘this’ argument of ‘void A::p()’ discards qualifiers [-fpermissive]
The problem is some of Android codes still have above bugs in its code - ex. frameworks/base/libs/utils/RefBase.cpp.
So, even if Android source code was successfully compiled at g++-4.4 or g++4.5, it may be failed at g++-4.6 (for example, upgrading host OS)
[ cc/gcc issue ]
Compiling with gcc-4.6 raises following warings.
<command-line>:0:0: warning: "_FORTIFY_SOURCE" redefined [enabled by default]
In some component which uses '-Werror' option, this warning stops compilation.
[ Conclusion ]
So, you would better to use gcc/g++-4.4 instead of 4.6 when building Android, until above issues are resolved on Android baseline.
(ex. Ubuntu 11.10 as an Android host OS.)
'Language > C&C++' 카테고리의 다른 글
[C/C++/JAVA] 변수를 block중간에 선언하는 방법에 대한 단상. (0) | 2011.11.23 |
---|---|
[C/C++] enable/disable function/macro with define switch. (0) | 2011.11.23 |
[C/C++] func() vs. func(void) (0) | 2011.07.27 |
[C/C++] Tips for OOP - module initialization. (0) | 2011.05.17 |
[Linux][C/C++] strange pipe issue in linux in 'ylisp'. (0) | 2011.02.09 |