[clang] [llvm] Prefer std::getenv to ::getenv (PR #108529)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Fri Sep 13 06:53:52 PDT 2024
AaronBallman wrote:
> > Are we sure this is going to do what we think?
> > https://github.com/llvm/llvm-project/blob/a41bb71f2216cef08ab04f1d730ae1701c145f3c/libcxx/include/cstdlib#L127
> >
> > https://github.com/gcc-mirror/gcc/blob/494d3c3faaee0dbde696ea334f8e242ae85ae2b5/libstdc%2B%2B-v3/include/c_compatibility/stdlib.h#L65
>
> I am not sure if I understand the code you pointed to. That's one of the reasons I did not want to expand that patch beyond clang and llvm.
Both libc++ and libstdc++ (which target POSIX systems) seem to have no code that provides those thread-safety guarantees; they're exposing `::getevn` as `std::getenv`. So I don't think this actually resolves any issues.
CC @ldionne @philnik777 for more opinions
https://github.com/llvm/llvm-project/pull/108529
More information about the cfe-commits
mailing list