Boost logo

Boost Users :

Subject: Re: [Boost-users] [config] TI compiler warning "static local variables of extern inline function are not resolved to single copy"
From: John Maddock (boost.regex_at_[hidden])
Date: 2011-11-04 14:41:14


> I use some boost libraries with a TI compiler. One of it's defects
> is "static local variables of extern inline function are not resolved to
> single copy". It emits a warning about it.
>
> My typical workaround for this is making such a function non-inline. This
> may require to move such a function definition out of a header file, if it
> isn't a template function.
>
> When I need a non-template function to be defined inside a header file,
> and
> return an instance of a static variable, i can't just make that function
> static (or put it into an unnamed namespace), because there will no longer
> be a single instance of the returned variable.Therefore I came up with the
> following:

As we don't have a config for that compiler, and given that it's probably
the only compiler effected, my suggestion is to just use a BOOST_WORKAROUND
in this case, especially if only a couple of file need patching.

Regards, John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net