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

It's not just macOS.

linux's glibc's ["allocates the buffer dynamically using malloc if buf is 
NULL."](https://www.man7.org/linux/man-pages/man3/getcwd.3.html)

And FreeBSD: [If buf is NULL, space is allocated as necessary to store the 
pathname. This space may later be 
free'd.](https://man.freebsd.org/cgi/man.cgi?query=getcwd&apropos=0&sektion=0&manpath=FreeBSD+14.2-RELEASE+and+Ports&arch=default&format=html)

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