Bug 180565

Summary: textproc/aspell compilation error with Clang
Product: Ports & Packages Reporter: dt71
Component: Individual Port(s)Assignee: FreeBSD Office Team <office>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: marino
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
aspell.patch none

Description dt71 2013-07-15 03:00:00 UTC
In file included from prog/aspell.cpp:38:
In file included from prog/check_funs.hpp:10:
In file included from prog/checker_string.hpp:14:
In file included from ./common/document_checker.hpp:10:
In file included from ./common/filter.hpp:13:
In file included from ./common/posib_err.hpp:13:
./common/errors.hpp:17:36: error: redefinition of 'aerror_other' with a
      different type: 'const acommon::ErrorInfo *const' vs 'const struct AspellErrorInfo *const'
extern "C" const ErrorInfo * const aerror_other;
                                   ^
./interfaces/cc/aspell.h:240:45: note: previous definition is here
extern const struct AspellErrorInfo * const aerror_other;
                                            ^

This error message is repeated for a multitude of types.

How-To-Repeat: Try to build Aspell with a recent version of Clang (eg., r186084).
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-07-20 22:16:45 UTC
Responsible Changed
From-To: freebsd-ports-bugs->office

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dt71 2013-10-13 19:52:53 UTC
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.
Comment 3 Tijl Coosemans freebsd_committer freebsd_triage 2013-10-18 18:41:16 UTC
State Changed
From-To: open->closed

It seems to build fine with clang now.  Let me know if that's not the 
case for you. 


Comment 4 Tijl Coosemans freebsd_committer freebsd_triage 2013-10-18 18:41:16 UTC
Responsible Changed
From-To: office->tijl

It seems to build fine with clang now.  Let me know if that's not the 
case for you.
Comment 5 dt71 2013-10-22 22:18:50 UTC
tijl@FreeBSD.org wrote, On 10/18/2013 19:42:
> It seems to build fine with clang now.  Let me know if that's not the
> case for you.

Not the case. (Note: at the time of this writing, Clang r192389 is used here.)
Comment 6 Tijl Coosemans freebsd_committer freebsd_triage 2013-10-22 22:51:59 UTC
On Tue, 22 Oct 2013 23:18:50 +0200 dt71@gmx.com wrote:
> tijl@FreeBSD.org wrote, On 10/18/2013 19:42:
>> It seems to build fine with clang now.  Let me know if that's not the
>> case for you.
> 
> Not the case. (Note: at the time of this writing, Clang r192389 is used here.)

The last i386 build succeeded:
http://beefy1.isc.freebsd.org/bulk/10i386-default/2013-10-17_04h52m04s/logs/aspell-0.60.6.1_2.log
Comment 7 Tijl Coosemans freebsd_committer freebsd_triage 2013-10-26 09:48:32 UTC
State Changed
From-To: closed->open

Reopen, submitter is using clang-devel port. 


Comment 8 Tijl Coosemans freebsd_committer freebsd_triage 2013-10-26 09:48:32 UTC
Responsible Changed
From-To: tijl->office

Reopen, submitter is using clang-devel port.
Comment 9 John Marino freebsd_committer freebsd_triage 2014-08-14 23:00:28 UTC
I suspect this is obsolete now, not activity in 10 months anyway.
Comment 10 dt71 2014-08-17 04:50:25 UTC
The compilation error will be apparent when the next version of Clang is imported.