I found this in our code base today, I wonder is this entirely safe or are we depending on the bahavior of the compiler here that these strings are static, and thus around after the function returns?
Code://----------------------------------------------------------------------------- const char* ProcessModule::DetermineLogFilePrefix() { if (this->Options) { switch (this->Options->GetProcessType()) { case Options::CLIENT: return NULL; // don't need a log for client. case Options::SERVER: return "ServerNodeLog"; case Options::RENDER_SERVER: return "RenderServerNodeLog"; case Options::DATA_SERVER: return "DataServerNodeLog"; } } return "NodeLog"; }



LinkBack URL
About LinkBacks


