From 63f6c104495777de70a27f838caa19fd0590a8aa Mon Sep 17 00:00:00 2001 From: vitaut Date: Sun, 14 Jun 2015 09:36:23 -0700 Subject: [PATCH] Suppress a warning about unused strerror_r. --- format.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/format.cc b/format.cc index d12424d0..bf7032bb 100644 --- a/format.cc +++ b/format.cc @@ -207,7 +207,10 @@ int safe_strerror( StrError(int error_code, char *&buffer, std::size_t buffer_size) : error_code_(error_code), buffer_(buffer), buffer_size_(buffer_size) {} - int run() { return handle(strerror_r(error_code_, buffer_, buffer_size_)); } + int run() { + strerror_r(0, 0, ""); // Suppress a warning about unused strerror_r. + return handle(strerror_r(error_code_, buffer_, buffer_size_)); + } }; return StrError(error_code, buffer, buffer_size).run(); }