================
@@ -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:

I checked the issue 128882, it references to the macOS man page for `getcwd` 
where a NULL `buf` argument is allowed. This is different from the original 
POSIX documentation where "the behavior of getcwd() is unspecified" if `buf` is 
NULL. This is why the condition is there. But "unspecified" does not mean 
invalid, so it may be correct to drop this requirement. But we must check how 
this affects the `BufferSizeConstraint`.

https://github.com/llvm/llvm-project/pull/135720
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to