Another VC compiler optimization bug:(
Last week, my leader had another annoying problem, a snippet like below is not working at all. The GetBool function will assign the 2nd argument “value” to true internally, while when returning, it is still false. 1: IMyNameValues src; 2: 3: ... 4: 5: if (destField == nullptr) 6: { 7: bool value; 8: System::String^ key = strConverter.Utf8ToString(srcField.Name); 9: mGuts->CheckCode(src.GetBool(srcField.Name, value)); 10: dest->AddField(key, value); 11: } 12: else if (destField->Type->DotNetType->Equals(System::Boolean:: typeid )) 13: { 14: bool value; 15: const char * pName = srcField.Name; 16: mGuts->CheckCode(( long )src.GetBool(srcField.Name, value)); 17: dest->AddField(destField, value); 18: } 19: 20: ... 21: 22: //the GetBool function's signature is like: 23: long GetBool( const string& name, bool & value); Afte...