From: Dan Gohman Date: Tue, 10 Feb 2009 17:56:28 +0000 (+0000) Subject: Use const, to support platforms where strrchr returns a const char *. X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=d4e1845849fb0499c9d0e2761f1fdddc9cdf32a8;p=oota-llvm.git Use const, to support platforms where strrchr returns a const char *. This fixes PR3535. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64224 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/System/Unix/Signals.inc b/lib/System/Unix/Signals.inc index 9c1050cf8a0..e42841263ea 100644 --- a/lib/System/Unix/Signals.inc +++ b/lib/System/Unix/Signals.inc @@ -78,7 +78,7 @@ static void PrintStackTrace() { for (int i = 0; i < depth; ++i) { Dl_info dlinfo; dladdr(StackTrace[i], &dlinfo); - char* name = strrchr(dlinfo.dli_fname, '/'); + const char* name = strrchr(dlinfo.dli_fname, '/'); int nwidth; if (name == NULL) nwidth = strlen(dlinfo.dli_fname); @@ -93,7 +93,7 @@ static void PrintStackTrace() { fprintf(stderr, "%-3d", i); - char* name = strrchr(dlinfo.dli_fname, '/'); + const char* name = strrchr(dlinfo.dli_fname, '/'); if (name == NULL) fprintf(stderr, " %-*s", width, dlinfo.dli_fname); else fprintf(stderr, " %-*s", width, name+1);