为什么 getenv() return 是一个非常量字符串

Why does getenv() return a non-const string

我正在阅读 cppreference.comstd::getenv() 函数的文档,上面写着

Modifying the string returned by getenv invokes undefined behavior.

那为什么函数不return一个const char*

Then why does the function not return a const char*?

可能是因为与根本不支持 const 的旧 c 标准兼容。