Date: Sun, 13 Oct 2013 19:00:01 GMT From: dt71@gmx.com To: office@FreeBSD.org Subject: Re: ports/180565: textproc/aspell compilation error with Clang Message-ID: <201310131900.r9DJ011p013922@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR ports/180565; it has been noted by GNATS. From: dt71@gmx.com To: bug-followup@FreeBSD.org Cc: Subject: Re: ports/180565: textproc/aspell compilation error with Clang Date: Sun, 13 Oct 2013 20:52:53 +0200 This is a multi-part message in MIME format. --------------000209060005000400040704 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit When compiling the C++ parts, essentially the following is given to the compiler: // in aspell.h #ifdef __cplusplus__ extern "C" { #endif extern const struct AspellErrorInfo * const aerror_other; // (1) #ifdef __cplusplus__ } #endif // in errors.hpp namespace acommon { struct ErrorInfo; extern "C" const ErrorInfo * const aerror_other; } On the C side, the aerror_other symbol obviously must have a C type, it is ``const struct AspellErrorInfo *const''. There is a hack to give this symbol a C++ish type on the C++ side: ``const acommon::ErrorInfo *const''; the types are supposedly compatible. Unfortunately, Clang sees the type clash, because both are ``extern "C"''d. An instant fix would be to not define the C version of aerror_other when compiling C++ code, by placing a __cplusplus guard around the line marked as ``(1)'' above. --------------000209060005000400040704 Content-Type: text/x-patch; name="aspell.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="aspell.patch" --- interfaces/cc/aspell.h 2013-10-13 20:29:33.000000000 +0200 +++ interfaces/cc/aspell.h 2013-10-13 20:30:01.000000000 +0200 @@ -237,6 +237,7 @@ /******************************** errors ********************************/ +#ifndef __cplusplus extern const struct AspellErrorInfo * const aerror_other; extern const struct AspellErrorInfo * const aerror_operation_not_supported; extern const struct AspellErrorInfo * const aerror_cant_copy; @@ -322,6 +323,7 @@ extern const struct AspellErrorInfo * const aerror_bad_magic; extern const struct AspellErrorInfo * const aerror_expression; extern const struct AspellErrorInfo * const aerror_invalid_expression; +#endif /******************************* speller *******************************/ --------------000209060005000400040704--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201310131900.r9DJ011p013922>