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.