diff options
author | Edwin Vane <edwin.vane@intel.com> | 2013-01-28 19:34:42 +0000 |
---|---|---|
committer | Edwin Vane <edwin.vane@intel.com> | 2013-01-28 19:34:42 +0000 |
commit | 44338e00f841a49abd6f25f9b2cfd2050fa3d449 (patch) | |
tree | 39dc3544f5a61e9a1d0d2ff64ffdb38e9c476c7c /llvm/lib/Support/Unix | |
parent | 072fb1a403963a37ad256bd83f3e56a80e4b4275 (diff) | |
download | bcm5719-llvm-44338e00f841a49abd6f25f9b2cfd2050fa3d449.tar.gz bcm5719-llvm-44338e00f841a49abd6f25f9b2cfd2050fa3d449.zip |
Fix gcc/printf/ISO C++ warning
Remove the use of the 't' length modifier to avoid a gcc warning. Based
on usage, 32 bits of precision is good enough for printing a stack
offset for a stack trace.
't' length modifier isn't in C++03 but it *is* in C++11. Added a FIXME
to reintroduce once LLVM makes the switch to C++11.
Reviewer: gribozavr
llvm-svn: 173711
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r-- | llvm/lib/Support/Unix/Signals.inc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Support/Unix/Signals.inc b/llvm/lib/Support/Unix/Signals.inc index 87162d6951d..af9e739e6d2 100644 --- a/llvm/lib/Support/Unix/Signals.inc +++ b/llvm/lib/Support/Unix/Signals.inc @@ -295,7 +295,11 @@ void llvm::sys::PrintStackTrace(FILE *FD) { else fputs(d, FD); free(d); - fprintf(FD, " + %tu",(char*)StackTrace[i]-(char*)dlinfo.dli_saddr); + // FIXME: When we move to C++11, use %t length modifier. It's not in + // C++03 and causes gcc to issue warnings. Losing the upper 32 bits of + // the stack offset for a stack dump isn't likely to cause any problems. + fprintf(FD, " + %u",(unsigned)((char*)StackTrace[i]- + (char*)dlinfo.dli_saddr)); } fputc('\n', FD); } |