I have to maintain binary compatibility for this C++ library that I'm working on.
Currently, I have something along these lines
class Foo
{
void Bar()
{
static bool flag = true;
}
}
Will removing flag
break binary compatibility of Foo
?
Aside My compiler presently is VC7.1 if that matters.
The static
variable is not part of the function's interface, so it won't affect binary compatibility. You should be aware, none the less, that if the function is really that simple, it might have been inlined in which case unless you recompile all users you will be breaking the ODR.
Simple advice: recompile if at all possible. Make sure that it was not inlined in the original code if not possible.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With