[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: building dbuskit fails with llvm/clang
From: |
Sebastian Reitenbach |
Subject: |
Re: building dbuskit fails with llvm/clang |
Date: |
Sat, 09 Apr 2011 12:01:38 +0200 |
User-agent: |
Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.9.2.14) Gecko/20110404 Thunderbird/3.1.8 |
On 04/09/11 11:39, David Chisnall wrote:
> On 9 Apr 2011, at 10:29, Sebastian Reitenbach wrote:
>
>> DKArgument.m:495:14: error: equality comparison with extraneous
>> parentheses [-Werror,-Wparentheses]
>> if ((type == DKDBusTypeForObjCType([sig methodReturnType])))
>> ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> We've been through this one before. The added complication here is that
> Niels has picked up my habit of using -Werror to make it harder to ignore
> warnings, so a small style point is now stopping it building.
>
>> DKEndpointManager.m:187:6: error: receiver 'GSStackTrace' is a forward
>> class and corresponding @interface may not exist [-Werror]
>> [[[GSStackTrace alloc] init] release];
>> ^
> Clang is a bit more aggressive about checking for messages that the receiver
> doesn't advertise understanding than gcc. If you forward-declare a class
> with @class, then there is no guarantee that it responds to any messages.
>
> I'm not sure why this code is using GSStackTrace, since the useful
> functionality of this class is exposed in NSException via public interfaces.
>
>> both GSStackTrace and DKWatcher are added with @class statement. They
>> are both defined within a .m file, so not possible to include/import a
>> .h file, which I'd have guessed would make the error go away.
> The simplest solution is to add a private declaration of the class as:
>
> @interface GSStackTrace : NSObject @end
>
> I think the correct solution is to allow something like this:
>
> @class<NSObject> GSStackTrace;
with this I get the error:
DKEndpointManager.m:51:8: error: expected identifier
@class <NSObject> GSStackTrace;
but with attached patch, picking up your simplest solution above, it works.
But then afterwards I get:
clang DKInterface.m -c \
-MMD -MP -DGNUSTEP -DGNUSTEP_BASE_LIBRARY=1
-DGNU_GUI_LIBRARY=1 -DGNU_RUNTIME=1 -DGNUSTEP_BASE_LIBRARY=1
-fno-strict-aliasing -fPIC -DDEBUG -fno-omit-frame-pointer -Wall
-DGSWARN -DGSDIAGNOSE -Wno-import -O2 -pipe -g -fgnu-runtime
-I/usr/local/include/dbus-1.0 -I/usr/local/lib/dbus-1.0/include -Wall
-Wdeclaration-after-statement -Werror
-fconstant-string-class=NSConstantString -I./derived_src -I.
-I/usr/local/include
-I/gnustep-dbuskit-0.1_writes_to_HOME/GNUstep/Library/Headers
-I/usr/local/include \
-o obj/DBusKit.obj/DKInterface.m.o
DKInterface.m:153:65: error: if statement has empty body
[-Werror,-Wempty-body]
&& (NO == [method isKindOfClass: [DKPropertyMethod class]]));
^
1 error generated.
the other patch attached fixes this.
Sebastian
> This would forward-declare the class, and also advertise that it conforms to
> the NSObject protocol.
>
> David
>
> -- Sent from my Difference Engine
patch-Source_DKEndpointManager_m
Description: Text document
patch-Source_DKInterface_m
Description: Text document