[cmake-developers] [PATCH v3 2/7] Deprecate const char* SystemTools::GetEnv function

Brad King brad.king at kitware.com
Thu Jul 7 08:44:51 EDT 2016


On 07/06/2016 03:12 PM, Dāvis Mosāns wrote:
> On Windows this function returns environment variable encoded
> in ANSI codepage which might not match internally used encoding.
[snip]
> -  static const char* GetEnv(const char* key);
> -  static const char* GetEnv(const std::string& key);
> +  DEPRECATED static const char* GetEnv(const char* key);
> +  DEPRECATED static const char* GetEnv(const std::string& key);

Please also revise these to return the properly converted string
and use a static std::map internally to manage the storage.  I'd
like the two overloads to at least return consistent values.  The
need for the internal map is a good justification for adding the
deprecation mark.

Thanks,
-Brad


More information about the cmake-developers mailing list