discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: strange new errors


From: David Chisnall
Subject: Re: strange new errors
Date: Wed, 20 May 2020 10:05:34 +0100
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0

Hi Andreas,

These warnings are fine to ignore (they should be guarded by debug builds of libobjc2 or an environment variable, but they aren't currently). You're seeing them now because Richard found and half fixed a bug in our detection of when to use the fast paths, and I finished and merged the patch about a week ago.

The warning is badly worded (my fault) and just means that the class will not use fast paths for ARC. A few of these could easily be made to go away (NSNull, GSDateSingle, and a few others are singletons and implement -retain defensively to avoid retain calls. The runtime now provides a better mechanism for doing this, but I haven't yet exposed it. The ARC implementation has a notion of persistent objects [e.g. NSConstantString] for which it skips all ARC-related calls. Opting in to this will let NSObject's -retain / -release become no-ops if they're every called).

Some of the others are implementing -retain to copy. These are strictly wrong. The spec for -retain requires that it returns self. Code compiled with ARC may or may not do the right thing here (depending on your compilation flags, the compiler may use the return value of objc_retain, but it may ignore it. objc_retain returns the argument so that the compiler can avoid spilling the value across calls - it's guaranteed to be in the return register).

I believe the small objects don't need to implement any of these methods. The runtime should be hitting fast paths for them and not calling memory management methods and if you call NSObject's -retain / -release / -autorelease then these should be delegating to the runtime for any GNUstep build that targets a runtime that supports small objects.

David

On 20/05/2020 08:45, Andreas Fink wrote:

Hello all,

I recompiled the latest version of gnustep yesterday with clang-10 and now I 
see the following error messages at startup.


NSAutoreleasePool does not support ARC correctly (implements retain)
GSPlaceholderString does not support ARC correctly (implements retain)
GSMutableString does not support ARC correctly (implements retain)
NSConstantString does not support ARC correctly (implements retain)
GSTinyString does not support ARC correctly (implements retain)
GSPlaceholderValue does not support ARC correctly (implements retain)
GSMutableArray does not support ARC correctly (implements retain)
GSPlaceholderArray does not support ARC correctly (implements retain)
GSPlaceholderTimeZone does not support ARC correctly (implements retain)
NSLocalTimeZone does not support ARC correctly (implements retain)
_NSConcreteProcessInfo does not support ARC correctly (implements retain)
GSDateSingle does not support ARC correctly (implements retain)
GSDateFuture does not support ARC correctly (implements retain)
NSSmallInt does not support ARC correctly (implements retain)
NSBundle does not support ARC correctly (implements release)
NSNull does not support ARC correctly (implements retain)


all my code is compiled with ARC which shouldnt stop clang calling code which 
is non ARC.
why do we see these errors and whats the workaround?
And is there any memory management problem here really or can it be safely 
ignored.







reply via email to

[Prev in Thread] Current Thread [Next in Thread]