Re: Bug#116823: Debian's g++-3.0 forgets to generate some code.
On Sat, 27 Oct 2001, Nathan Myers wrote:
[...]
> > I'd say that the best solution would be to get rid of globals. This is
> > actually very easy:
> >
> > If you have
> > TYPE VAR = INITIALIZER;
> > replace that with
> > TYPE& getVAR(){ static TYPE obj = INITIALIZER; return obj; }
> >
> > Then use getVAR() whereever you've used VAR before. For backwards
> > compatibility, you can even do
> >
> > #define VAR (getVAR())
> >
> > In understand that modules don't share global objects (perhaps except
> > for the module singleton), so removing global should be a local change
> > inside each module only.
>
> Beware, use of nontrivial static local initialization is inherently
> thread-unsafe without direct compiler support.
Sure, but threads are not an issue here. We're using reference counting
all over the place...
Regards
-richy.
--
.''`. Richard B. Kreckel
: :' : <kreckel@debian.org>
`. `' <kreckel@ginac.de>
`- <http://www.ginac.de/~kreckel/>
Reply to: