I have a class that uses environment variables as part of its
initialization. The following used to work using the Lucent SCL but now
fails with STL.
string env = getenv("ENV_VALUE");
// string env(getenv("ENV_VALUE")); // tried this just in case it
was problem with operator=.
if(env.empty()){
// handle this situation
}
It appears that the string class does not check for null pointers on
initialization. Am getting core dump. Stack trace indicates unhandled
exception.
I dont' have a choice in using the environment variable at to set this
variable.
I can work around this easily enough, but don't think I should have to.
Anyone seen this before?
Platform info: Solaris 2.8 - Forte 6.2 compiler
Thanks,
Thomas