summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorYaron Keren <yaron.keren@gmail.com>2014-12-04 21:36:38 +0000
committerYaron Keren <yaron.keren@gmail.com>2014-12-04 21:36:38 +0000
commitd908941236f83007373af83eaa6e25af03faab27 (patch)
tree4e340b6382f2a0aa57a5ffbd4d0b7aca9e18cafd /llvm/lib/Support
parentb313e46cc6e287376532154b7d763c90282e48e4 (diff)
downloadbcm5719-llvm-d908941236f83007373af83eaa6e25af03faab27.tar.gz
bcm5719-llvm-d908941236f83007373af83eaa6e25af03faab27.zip
Silence warning: variable 'buffer' set but not used.
llvm-svn: 223389
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/Errno.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/llvm/lib/Support/Errno.cpp b/llvm/lib/Support/Errno.cpp
index 1eefa3e6f8d..3ba2a1277d0 100644
--- a/llvm/lib/Support/Errno.cpp
+++ b/llvm/lib/Support/Errno.cpp
@@ -35,12 +35,14 @@ std::string StrError() {
#endif // HAVE_ERRNO_H
std::string StrError(int errnum) {
- const int MaxErrStrLen = 2000;
- char buffer[MaxErrStrLen];
- buffer[0] = '\0';
std::string str;
if (errnum == 0)
return str;
+#if defined(HAVE_STRERROR_R) || HAVE_DECL_STRERROR_S
+ const int MaxErrStrLen = 2000;
+ char buffer[MaxErrStrLen];
+ buffer[0] = '\0';
+#endif
#ifdef HAVE_STRERROR_R
// strerror_r is thread-safe.
OpenPOWER on IntegriCloud