ObjC PR/6328 (fwd)

Nicola Pero nicola@brainstorm.co.uk
Wed Jul 3 08:36:00 GMT 2002


Just to record that PR/6238 should be closed.

---------- Forwarded message ----------
Date: 03 Jul 2002 17:12:37 +0200
From: "[ISO-8859-1] Cédric Marcone" <marcone@mdeo.fr>
To: Nicola Pero <nicola@brainstorm.co.uk>
Cc: Didier Pralon <didier.pralon@mdeo.fr>, gcc-gnats@gcc.gnu.org
Subject: Re: ObjC PR/6328

Thank you very much.


On Wed, 2002-07-03 at 17:10, Nicola Pero wrote:
> 
> > Hi Nicola,
> > 
> > in fact my bug report was bugged !!
> > 
> > The real problem is described below, and the test case is attached.
> > 
> > When classes are defined in an external static library, you must
> > explicitly ask the Objc-Runtime to reference them or it is not aware of
> > their existence.
> > 
> > To do so, we are calling +initialize manually on those classes. In this
> > specific case, the Objc-Runtime does not prevent further calls and will
> > issue a second +initialize when trying to instanciate those classes.
> 
> Thanks - very interesting indeed (the testcase was great :-) ).
> 
> My suggestion is simply to use
> 
>  [B class];
> 
> instead of 
> 
>  [B initialize];
> 
> to have B referenced by the ObjC runtime ... that will cause the runtime
> to automatically drag in B, and also call +initialize (should be
> guaranteed once) and everything will work happily.
> 
> I think this is the proper way of dragging in classes, and when I changed
> the testcase to do it, the runtime seemed to behave very properly.
> 
> Let me know if you are happy with this solution, or if I have missed
> something.
> 
> 
-- 
Cédric Marcone
MDEO Lyon
Centre de Technologie
(+33) 4 72 07 92 93



More information about the Gcc-bugs mailing list