Now LibreOffice uses gnu++0x mode for C++ compilation if available, we should stop assuming NULL for C++ is an integral type (e.g., 0L) because some platforms rightfully define it as nullptr. For example, recent FreeBSD defines NULL like this: #if !defined(__cplusplus) #define NULL ((void *)0) #else #if __cplusplus >= 201103L #define NULL nullptr #elif defined(__GNUG__) && defined(__GNUC__) && __GNUC__ >= 4 #define NULL __null #else #if defined(__LP64__) #define NULL (0L) #else #define NULL 0 #endif /* __LP64__ */ #endif /* __GNUG__ */ #endif /* !__cplusplus */ With GCC 4.7+ (and Clang 3.2+), __cplusplus is correctly defined as 201103L and it is causing lots of build issues with these new C++ compilers.
Created attachment 65048 [details] A patch to fix internal CLucene
Created attachment 65049 [details] A patch to fix getCppuType
There may be more of these but I found these two major problems so far.
Jung-uk Kim, thank you for those patches. They do look good (I just wonder whether the "return (vt_)NULL;" in CLucene is really necessary, or could rather be simplified to "return NULL;"), but we would need a statement from you to the mailing list (libreoffice@lists.freedesktop.org) stating which license they are under (preferably MPL/LGPLv3+ dual licensed), and adding that to <http://wiki.documentfoundation.org/Development/Developers>.
(In reply to comment #4) > Jung-uk Kim, thank you for those patches. They do look good (I just wonder > whether the "return (vt_)NULL;" in CLucene is really necessary, or could rather > be simplified to "return NULL;"), but we would need a statement from you to the > mailing list (libreoffice@lists.freedesktop.org) stating which license they are > under (preferably MPL/LGPLv3+ dual licensed), and adding that to > <http://wiki.documentfoundation.org/Development/Developers>. CLucene patch is necessary, at least for Clang: /home/jkim/clucene-core-2.3.3.4/src/core/CLucene/util/VoidMap.h:86:11: error: cannot initialize return object of type 'lucene::document::DateTools::Resolution' with an rvalue of type 'nullptr_t' return NULL; ^~~~ I'm fine with MPL/LGPLv3+ dual-licensing. BTW, is it necessary to send a separate e-mail? I mean Bugzilla won't disappear and it's automatically forwarded to the ML, right? If it is really needed, it will be done. Thanks!
Jung-uk Kim committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e19cd3f8a39fdb9878cb573438e04ae325405ffe fdo#53061: Fix for C++11 #define NULL nullptr
Jung-uk Kim committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=ed93117447a3217fab0e2425f8761e24423024b5 fdo#53061: Fix for C++11 #define NULL nullptr
(In reply to comment #5) > CLucene patch is necessary, at least for Clang: > > /home/jkim/clucene-core-2.3.3.4/src/core/CLucene/util/VoidMap.h:86:11: error: > cannot initialize return object of type > 'lucene::document::DateTools::Resolution' with an rvalue of type > 'nullptr_t' > return NULL; > ^~~~ ah right, Resolution is an enum there > I'm fine with MPL/LGPLv3+ dual-licensing. BTW, is it necessary to send a > separate e-mail? I mean Bugzilla won't disappear and it's automatically > forwarded to the ML, right? If it is really needed, it will be done. Thanks! Probably enough to have it recorded here in this issue. I added you to the roster as <https://wiki.documentfoundation.org/index.php?title=Development/Developers&oldid=54368>. The two patches are applied now, see comment 6 and comment 7. Thanks again. Did you file the CLucene patch also upstream at CLucene itself?
(In reply to comment #8) > The two patches are applied now, see comment 6 and comment 7. Thanks again. Great, thanks! > Did you file the CLucene patch also upstream at CLucene itself? No, I didn't feel it's necessary because it looks like the project does not have an active maintainer any more. The last commit was more than a year ago although there were several patch submissions after the release. :-( http://clucene.git.sourceforge.net/git/gitweb.cgi?p=clucene/clucene;a=summary http://sourceforge.net/tracker/?group_id=80013&atid=558446 http://sourceforge.net/mailarchive/forum.php?forum_name=clucene-developers
Created attachment 65571 [details] A patch to fix svx. I found one more file to fix.
Stephan Bergmann committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=e413403590c3fb68a62db6d34d202e320fd99017 fdo#53061: Work around boost::ptr_vector.insert(..., nullptr) problem