Browse Source

[3839] unused exception handler variable aka #3839

Francis Dupont 10 years ago
parent
commit
2cd955a844

+ 1 - 1
src/lib/dhcp/libdhcp++.cc

@@ -746,7 +746,7 @@ void initOptionSpace(OptionDefContainer& defs,
 
         try {
             definition->validate();
-        } catch (const isc::Exception& ex) {
+        } catch (const isc::Exception&) {
             // This is unlikely event that validation fails and may
             // be only caused by programming error. To guarantee the
             // data consistency we clear all option definitions that

+ 2 - 2
src/lib/dhcp/option4_client_fqdn.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -218,7 +218,7 @@ setDomainName(const std::string& domain_name,
         try {
             domain_name_.reset(new isc::dns::Name(name));
 
-        } catch (const Exception& ex) {
+        } catch (const Exception&) {
             isc_throw(InvalidOption4FqdnDomainName,
                       "invalid domain-name value '"
                       << domain_name << "' when setting new domain-name for"

+ 4 - 4
src/lib/dhcp/option6_client_fqdn.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2014 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -189,7 +189,7 @@ setDomainName(const std::string& domain_name,
         try {
             domain_name_.reset(new isc::dns::Name(name, true));
 
-        } catch (const Exception& ex) {
+        } catch (const Exception&) {
             isc_throw(InvalidOption6FqdnDomainName, "invalid domain-name value '"
                       << domain_name << "' when setting new domain-name for"
                       << " DHCPv6 Client FQDN Option");
@@ -249,7 +249,7 @@ Option6ClientFqdnImpl::parseWireData(OptionBufferConstIter first,
             isc::util::InputBuffer name_buf(&buf[0], buf.size());
             try {
                 domain_name_.reset(new isc::dns::Name(name_buf, true));
-            } catch (const Exception& ex) {
+            } catch (const Exception&) {
                 isc_throw(InvalidOption6FqdnDomainName, "failed to parse"
                           "partial domain-name from wire format");
             }
@@ -264,7 +264,7 @@ Option6ClientFqdnImpl::parseWireData(OptionBufferConstIter first,
                                             std::distance(first, last));
             try {
                 domain_name_.reset(new isc::dns::Name(name_buf, true));
-            } catch (const Exception& ex) {
+            } catch (const Exception&) {
                 isc_throw(InvalidOption6FqdnDomainName, "failed to parse"
                           "fully qualified domain-name from wire format");
             }

+ 1 - 1
src/lib/dhcp_ddns/ncr_msg.cc

@@ -506,7 +506,7 @@ NameChangeRequest::setIpAddress(const std::string& value) {
     // Validate IP Address.
     try {
         ip_io_address_ = isc::asiolink::IOAddress(value);
-    } catch (const isc::asiolink::IOError& ex) {
+    } catch (const isc::asiolink::IOError&) {
         isc_throw(NcrMessageError,
                   "Invalid ip address string for ip_address: " << value);
     }

+ 1 - 1
src/lib/dhcpsrv/csv_lease_file4.cc

@@ -62,7 +62,7 @@ CSVLeaseFile4::append(const Lease4& lease) {
 
     try {
         CSVFile::append(row);
-    } catch (const std::exception& ex) {
+    } catch (const std::exception&) {
         // Catch any errors so we can bump the error counter than rethrow it
         ++write_errs_;
         throw;

+ 1 - 1
src/lib/dhcpsrv/csv_lease_file6.cc

@@ -61,7 +61,7 @@ CSVLeaseFile6::append(const Lease6& lease) {
     }
     try {
         CSVFile::append(row);
-    } catch (const std::exception& ex) {
+    } catch (const std::exception&) {
         // Catch any errors so we can bump the error counter than rethrow it
         ++write_errs_;
         throw;

+ 1 - 1
src/lib/dhcpsrv/lease_file_loader.h

@@ -199,7 +199,7 @@ public:
              ++lease) {
             try {
                 lease_file.append(**lease);
-            } catch (const isc::Exception& ex) {
+            } catch (const isc::Exception&) {
             // Close the file
             lease_file.close();
             throw;

+ 1 - 1
src/lib/dhcpsrv/logging.cc

@@ -76,7 +76,7 @@ void LogConfigParser::parseConfigEntry(isc::data::ConstElementPtr entry) {
     }
     try {
         info.severity_ = isc::log::getSeverity(severity_ptr->stringValue().c_str());
-    } catch (const std::exception& ex) {
+    } catch (const std::exception&) {
         isc_throw(BadValue, "Unsupported severity value '"
                   << severity_ptr->stringValue() << "' ("
                   << severity_ptr->getPosition() << ")");

+ 5 - 5
src/lib/dhcpsrv/memfile_lease_mgr.cc

@@ -201,7 +201,7 @@ LFCSetup::execute() {
             .arg(process_->getCommandLine());
         pid_ = process_->spawn();
 
-    } catch (const ProcessSpawnError& ex) {
+    } catch (const ProcessSpawnError&) {
         LOG_ERROR(dhcpsrv_logger, DHCPSRV_MEMFILE_LFC_SPAWN_FAIL);
     }
 }
@@ -682,7 +682,7 @@ Memfile_LeaseMgr::initLeaseFilePath(Universe u) {
     std::string persist_val;
     try {
         persist_val = getParameter("persist");
-    } catch (const Exception& ex) {
+    } catch (const Exception&) {
         // If parameter persist hasn't been specified, we use a default value
         // 'yes'.
         persist_val = "true";
@@ -700,7 +700,7 @@ Memfile_LeaseMgr::initLeaseFilePath(Universe u) {
     std::string lease_file;
     try {
         lease_file = getParameter("name");
-    } catch (const Exception& ex) {
+    } catch (const Exception&) {
         lease_file = getDefaultLeaseFilePath(u);
     }
     return (lease_file);
@@ -786,14 +786,14 @@ Memfile_LeaseMgr::lfcSetup() {
     std::string lfc_interval_str = "0";
     try {
         lfc_interval_str = getParameter("lfc-interval");
-    } catch (const std::exception& ex) {
+    } catch (const std::exception&) {
         // Ignore and default to 0.
     }
 
     uint32_t lfc_interval = 0;
     try {
         lfc_interval = boost::lexical_cast<uint32_t>(lfc_interval_str);
-    } catch (boost::bad_lexical_cast& ex) {
+    } catch (boost::bad_lexical_cast&) {
         isc_throw(isc::BadValue, "invalid value of the lfc-interval "
                   << lfc_interval_str << " specified");
     }

+ 1 - 1
src/lib/dhcpsrv/parsers/dhcp_parsers.cc

@@ -357,7 +357,7 @@ OptionDataParser::extractCode(ConstElementPtr parent) const {
     try {
         code = uint32_values_->getParam("code");
 
-    } catch (const exception& ex) {
+    } catch (const exception&) {
         // The code parameter was not found. Return an unspecified
         // value.
         return (OptionalValue<uint32_t>());

+ 1 - 1
src/lib/dns/rdata.cc

@@ -235,7 +235,7 @@ Generic::constructFromLexer(MasterLexer& lexer) {
 
     try {
         rdlen = lexer.getNextToken(MasterToken::NUMBER).getNumber();
-    } catch (const MasterLexer::LexerError& ex) {
+    } catch (const MasterLexer::LexerError&) {
         isc_throw(InvalidRdataLength,
                   "Unknown RDATA length is invalid");
     }

+ 2 - 2
src/lib/log/tests/logger_lock_test.cc

@@ -1,4 +1,4 @@
-// Copyright (C) 2012  Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2012, 2015  Internet Systems Consortium, Inc. ("ISC")
 //
 // Permission to use, copy, modify, and/or distribute this software for any
 // purpose with or without fee is hereby granted, provided that the above
@@ -40,7 +40,7 @@ protected:
         try {
             // This lock attempt is non-blocking.
             Mutex::Locker locker(LoggerManager::getMutex(), false);
-        } catch (Mutex::Locker::AlreadyLocked& e) {
+        } catch (Mutex::Locker::AlreadyLocked&) {
             cout << "FIELD1 FIELD2 LOGGER_LOCK_TEST: MUTEXLOCK\n";
         }
 

+ 2 - 2
src/lib/util/csv_file.cc

@@ -195,7 +195,7 @@ CSVFile::size() const {
         fs.seekg(0, std::ifstream::end);
         pos = fs.tellg();
         fs.close();
-    } catch (const std::exception& ex) {
+    } catch (const std::exception&) {
         return (0);
     }
     return (pos);
@@ -321,7 +321,7 @@ CSVFile::open(const bool seek_to_end) {
                 fs_->clear();
             }
 
-        } catch (const std::exception& ex) {
+        } catch (const std::exception&) {
             close();
             throw;
         }