i've inherited some (atrocious) code that was written in VC6 and when executing it in 2k5, the results are totally different.
so far, i've already identified one instance of relying on undefined behavior - where apparently 2k5 is more aggressive in taking variables off the stack than VC6. e.g:
Code:
class foo
{
public:
std::string mystring()
{
return _mystring;
}
private:
std::string _mystring;
};
void func()
{
foo f;
const char* const invalidPtr = f.mystring().c_str(); //this was ok in VC6, but 2k5 now properly deletes the copy of _mystring being retuned
}
if anyone else has any experience they could impart to me, gotchas such as the above, i'd appreciate it. i have probably well over a hundred thousand lines to comb through, and i'm armed only with the knowledge that 'it used to work'.