Re: strange new errors

2020-05-20 Thread Svetlana
Thank you, David



Re: strange new errors

2020-05-20 Thread David Chisnall

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.








strange new errors

2020-05-20 Thread Andreas Fink


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.