I don't know what OSX does, and having methods of a mutable class (other than 
-copy...) return immutable instances is unusual/unintuitive, but from a 
performance point of view (because character sets can consume a lot of memory) 
it makes complete sense for these methods to return shared/singleton instances 
of immutable character sets.
  

  

  

  
  
  
  
  
>   
> On 18 Jul 2025 at 10:00, Riccardo Mottola  <riccardo.mott...@libero.it>  
> wrote:
>   
>   
>  Hi,
>
> Frederik Seiffert wrote:
> >  I had changed these return types from id to NSCharacterSet in
> >   https://github.com/gnustep/libs-base/pull/501, because that is what
> >  the implementation returns by calling „copy“ on the created set before
> >  returning. This matches Apple platforms both in the implementation and
> >  header declaration.
>
> Oh, missed that one. This explain why these warnings are "new" (but the
> code itself is the same).
> I must then check what that call does on NSMutableCharacterSet on Apple
> and see if we need another subclass method or there is some
> inconsistency here.
> Will comment or make a PR in case.
>
> Riccardo
>
>     
     

Reply via email to