Lars Hagström wrote:
Hi,
I had some trouble with this, so I decided to try it out. The optimizations that cause the problem with MSVC is /Og and /Ob2 together (which are both part of /O2, optimize for speed).
As Ion says it is function inlining that is the problem, since when i added __declspec(noinline) to set_offset it all worked like a dream. Here is a very ugly fix for this problem (just an ifdef and a __declspec):
I've also found that "get_offset" is also incorrectly inlined, since some Interprocess tests crash after applying the patch. I've also tagged "get_offset" as "nonline" and everything seems ok. I've uploaded a new offset_ptr.hpp version to CVS disabling inlining in VC8 for both functions. I hope this solves VC8-Interprocess problems. Regards, Ion