From: Christopher Dykes Date: Fri, 16 Jun 2017 02:47:37 +0000 (-0700) Subject: Don't declare caught exceptions when not actually used X-Git-Tag: v2017.06.19.00~7 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=ab9a4d71366857cf1facc1642d7ef2fd04004cca;p=folly.git Don't declare caught exceptions when not actually used Summary: There are a couple of places where the caught exception was being given a name that was never used, generating a warning under MSVC. Reviewed By: simpkins Differential Revision: D5260131 fbshipit-source-id: f82c6bd1266f6a4c916594ec3ac94edc9a2e48fe --- diff --git a/folly/experimental/logging/LogLevel.cpp b/folly/experimental/logging/LogLevel.cpp index a60e024e..03e13d33 100644 --- a/folly/experimental/logging/LogLevel.cpp +++ b/folly/experimental/logging/LogLevel.cpp @@ -76,7 +76,7 @@ LogLevel stringToLogLevel(StringPiece name) { try { auto level = folly::to(lowerName); return static_cast(level); - } catch (const std::exception& ex) { + } catch (const std::exception&) { throw std::range_error("invalid logger name " + name.str()); } } diff --git a/folly/experimental/logging/LogStream.cpp b/folly/experimental/logging/LogStream.cpp index 3bf4acf6..f3ecbbe7 100644 --- a/folly/experimental/logging/LogStream.cpp +++ b/folly/experimental/logging/LogStream.cpp @@ -38,7 +38,7 @@ LogStreamBuffer::int_type LogStreamBuffer::overflow(int_type ch) { setp((&str_.front()) + currentSize + 1, (&str_.front()) + newSize); return ch; } - } catch (const std::exception& ex) { + } catch (const std::exception&) { // Return EOF to indicate that the operation failed. // In general the only exception we really expect to see here is // std::bad_alloc() from the str_.resize() call.