[clang] [llvm] [LLVM][Clang][Cygwin] Fix building Clang for Cygwin (PR #134494)

via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 5 10:52:57 PDT 2025


Mateusz =?utf-8?q?Mikuła?= <oss at mateuszmikula.dev>,
Mateusz =?utf-8?q?Mikuła?= <oss at mateuszmikula.dev>,
Mateusz =?utf-8?q?Mikuła?= <oss at mateuszmikula.dev>
Message-ID:
In-Reply-To: <llvm.org/llvm/llvm-project/pull/134494 at github.com>


================
@@ -847,7 +847,11 @@ void llvm::sys::PrintStackTrace(raw_ostream &OS, int Depth) {
 
     const char *name = strrchr(dlinfo.dli_fname, '/');
     if (!name)
+#ifdef __CYGWIN__
+      OS << format(" %-*s", width, &dlinfo.dli_fname);
----------------
jeremyd2019 wrote:

I am confused by this.  dli_fname is defined as
```c
char        dli_fname[PATH_MAX];
```
which in C rules should be the same as a `char *`.  Taking the address of the array would be a `char **`.  If the template is somehow unhappy with a `char[]`, maybe cast to `char *`, or take the address of the first element `&dlinfo.dli_fname[0]` ?

https://github.com/llvm/llvm-project/pull/134494


More information about the llvm-commits mailing list