[clang] Fixed issue #128882: don't warn if 1st argument to 'getcwd' is NULL (PR #135720)
Balázs Kéri via cfe-commits
cfe-commits at lists.llvm.org
Thu May 22 07:54:33 PDT 2025
================
@@ -105,9 +105,6 @@ void errno_getcwd(char *Buf, size_t Sz) {
clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
clang_analyzer_eval(Path == NULL); // expected-warning{{TRUE}}
if (errno) {} // no warning
- } else if (Path == NULL) {
- clang_analyzer_eval(errno != 0); // expected-warning{{TRUE}}
- if (errno) {} // no warning
----------------
balazske wrote:
For me it was more easy to create a new PR #141076. The code change is almost the same just added the new cases for NULL `Buf` argument. (Improvements are still possible like add the fact that a `malloc`-like allocation happens in this case (with initialized content).)
https://github.com/llvm/llvm-project/pull/135720
More information about the cfe-commits
mailing list