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

Mateusz Mikuła via cfe-commits cfe-commits at lists.llvm.org
Tue Apr 8 12:16:56 PDT 2025


================
@@ -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);
----------------
mati865 wrote:

Simple cast results in a warning on Linux:
```
/home/mateusz/Projects/llvm-project/llvm/lib/Support/Unix/Signals.inc:850:36: warning: cast from type ‘const char*’ to type ‘char*’ casts away qualifiers [-Wcast-qual]
  850 |       OS << format(" %-*s", width, (char *)dlinfo.dli_fname);
      |                                    ^~~~~~~~~~~~~~~~~~~~~~~~
```
I'll restore ifdef version.

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


More information about the cfe-commits mailing list