On Sun, Jun 14, 2009 at 06:37:15PM +0100, Andrew Price wrote:
> Yep that works. At least, it gets further now but there are a bunch more
> warnings and eventually an error elsewhere. I've attached the output of
> 
> make CC=clang messages=yes 2>build.err

I'm running into virtually identical issues (but I'm only trying to
build EtoileFoundation with clang, because that's where I'm still
working on map/fold/filter stuff that uses blocks).

> UKRunner.m:353:13: warning: method '-initForTest' not found (return type 
> defaults to 'id')
>                         object = [object initForTest];
>                                  ^~~~~~~~~~~~~~~~~~~~
> UKRunner.m:393:7: warning: method '-releaseForTest' not found (return type 
> defaults to 'id')
>                     [object releaseForTest];
>                     ^~~~~~~~~~~~~~~~~~~~~~~
> UKRunner.m:495:7: warning: method '-conformsTo:' not found (return type 
> defaults to 'id')
>                         if([protocol_list->list[i] conformsTo:aProtocol])
>                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 3 diagnostics generated.

This kind of error seems to be very common. It goes away if you either
explicitly declare that the object conforms to the NSObject protocol or
cast it to NSObject.

> ETXMLNode.m:75:8: error: implicitly declaring C library function 'index' with 
> type 'char *(char const *, int)'
>         while(index < count)
>               ^
> ETXMLNode.m:75:8: note: please include the header <strings.h> or explicitly 
> provide a declaration for 'index'
> 2 diagnostics generated.

This seems to result from the compiler treating index as a builtin while
it is really an instance variable (same thing in ObjectPlanes.(m|h)).
Renaming the index ivar will work around it. 

I had two additional problems: 1. clang uncovered an inconsistency
between the ETUUID interface and implementation in EtoileFoundation:

> ETUUID.m:232:1: error: conflicting return type in implementation of 
> 'UUIDValue': 'unsigned char *' vs 'unsigned char const *'
> - (const unsigned char *) UUIDValue
> ^
> In file included from ETUUID.m:9: 
> .../Etoile/Frameworks/EtoileFoundation/Headers/ETUUID.h:50:1: note: previous 
> definition is here
> - (unsigned char *) UUIDValue;
> ^

2. In the unistd.h system header, the encrypt function for XOpen has an
variable named __block which doesn't play nicely with the builtin clang
macor __block. The solution is not to define (or undefine) __USE_XOPEN.

With these workarounds, EtoileFoundation builds fine for me.

Cheers,


Niels

_______________________________________________
Etoile-discuss mailing list
[email protected]
https://mail.gna.org/listinfo/etoile-discuss

Répondre à