Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Don't name unused exceptions.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 3 May 2019 09:12:49 +0000 (11:12 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Fri, 3 May 2019 12:27:39 +0000 (14:27 +0200)
22 files changed:
examples/s4u/app-bittorrent/s4u-peer.cpp
examples/s4u/app-bittorrent/s4u-tracker.cpp
examples/s4u/dht-chord/s4u-dht-chord-node.cpp
examples/s4u/exec-ptask/s4u-exec-ptask.cpp
examples/s4u/platform-failures/s4u-platform-failures.cpp
src/kernel/routing/DragonflyZone.cpp
src/kernel/routing/FatTreeZone.cpp
src/mc/checker/simgrid_mc.cpp
src/msg/msg_comm.cpp
src/msg/msg_legacy.cpp
src/msg/msg_task.cpp
src/plugins/host_energy.cpp
src/plugins/link_energy.cpp
src/plugins/vm/VmLiveMigration.cpp
src/simdag/sd_daxloader.cpp
src/simix/smx_deployment.cpp
src/smpi/internals/smpi_utils.cpp
src/smpi/mpi/smpi_request.cpp
src/surf/xml/surfxml_sax_cb.cpp
src/xbt/exception.cpp
teshsuite/mc/dwarf-expression/dwarf-expression.cpp
teshsuite/xbt/mmalloc/mmalloc_test.cpp

index 1f28b3e..53317ba 100644 (file)
@@ -33,13 +33,13 @@ Peer::Peer(std::vector<std::string> args)
   try {
     id       = std::stoi(args[1]);
     mailbox_ = simgrid::s4u::Mailbox::by_name(std::to_string(id));
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid ID:") + args[1].c_str());
   }
 
   try {
     deadline = std::stod(args[2]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid deadline:") + args[2].c_str());
   }
   xbt_assert(deadline > 0, "Wrong deadline supplied");
@@ -84,7 +84,7 @@ bool Peer::getPeersFromTracker()
   try {
     XBT_DEBUG("Sending a peer request to the tracker.");
     tracker_mailbox->put(peer_request, TRACKER_COMM_SIZE, GET_PEERS_TIMEOUT);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Timeout expired when requesting peers to tracker");
     delete peer_request;
     return false;
@@ -97,7 +97,7 @@ bool Peer::getPeersFromTracker()
       if (id != peer_id)
         connected_peers.emplace(peer_id, Connection(peer_id));
     delete answer;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Timeout expired when requesting peers to tracker");
     return false;
   }
index f51e55d..b7bd4cd 100644 (file)
@@ -17,7 +17,7 @@ Tracker::Tracker(std::vector<std::string> args)
   // Retrieving end time
   try {
     deadline = std::stod(args[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid deadline:") + args[1].c_str());
   }
   xbt_assert(deadline > 0, "Wrong deadline supplied");
index 833f3eb..e1d3c23 100644 (file)
@@ -110,7 +110,7 @@ void Node::notifyAndQuit()
   XBT_DEBUG("Sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
   try {
     simgrid::s4u::Mailbox::by_name(std::to_string(fingers_[0]))->put(pred_msg, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Timeout expired when sending a 'PREDECESSOR_LEAVING' to my successor %d", fingers_[0]);
     delete pred_msg;
   }
@@ -124,7 +124,7 @@ void Node::notifyAndQuit()
 
     try {
       simgrid::s4u::Mailbox::by_name(std::to_string(pred_id_))->put(succ_msg, 10, timeout);
-    } catch (simgrid::TimeoutError& e) {
+    } catch (const simgrid::TimeoutError&) {
       XBT_DEBUG("Timeout expired when sending a 'SUCCESSOR_LEAVING' to my predecessor %d", pred_id_);
       delete succ_msg;
     }
@@ -214,7 +214,7 @@ void Node::checkPredecessor()
   XBT_DEBUG("Sending a 'Predecessor Alive' request to my predecessor %d", pred_id_);
   try {
     mailbox->put(message, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Failed to send the 'Predecessor Alive' request to %d", pred_id_);
     delete message;
     return;
@@ -229,7 +229,7 @@ void Node::checkPredecessor()
     comm->wait_for(timeout);
     XBT_DEBUG("Received the answer to my 'Predecessor Alive': my predecessor %d is alive", pred_id_);
     delete static_cast<ChordMessage*>(data);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Failed to receive the answer to my 'Predecessor Alive' request");
     pred_id_ = -1;
   }
@@ -255,7 +255,7 @@ int Node::remoteGetPredecessor(int ask_to)
   XBT_DEBUG("Sending a 'Get Predecessor' request to %d", ask_to);
   try {
     mailbox->put(message, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Failed to send the 'Get Predecessor' request to %d", ask_to);
     delete message;
     return predecessor_id;
@@ -273,7 +273,7 @@ int Node::remoteGetPredecessor(int ask_to)
               answer->answer_id);
     predecessor_id = answer->answer_id;
     delete answer;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Failed to receive the answer to my 'Get Predecessor' request");
     delete static_cast<ChordMessage*>(data);
   }
@@ -327,7 +327,7 @@ int Node::remoteFindSuccessor(int ask_to, int id)
   XBT_DEBUG("Sending a 'Find Successor' request to %d for id %d", ask_to, id);
   try {
     mailbox->put(message, 10, timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Failed to send the 'Find Successor' request to %d for id %d", ask_to, id_);
     delete message;
     return successor;
@@ -343,7 +343,7 @@ int Node::remoteFindSuccessor(int ask_to, int id)
               answer->request_id, id_, answer->answer_id);
     successor = answer->answer_id;
     delete answer;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_DEBUG("Failed to receive the answer to my 'Find Successor' request");
     delete static_cast<ChordMessage*>(data);
   }
index c3f804b..9759607 100644 (file)
@@ -55,7 +55,7 @@ static void runner()
     simgrid::s4u::this_actor::parallel_execute(hosts, computation_amounts, communication_amounts,
                                                10.0 /* timeout (in seconds)*/);
     xbt_die("Woops, this did not timeout as expected... Please report that bug.");
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     XBT_INFO("Caught the expected timeout exception.");
   }
 
index dea2f30..ceea314 100644 (file)
@@ -40,7 +40,7 @@ static int master(int argc, char* argv[])
       XBT_INFO("Send a message to %s", mailbox->get_cname());
       mailbox->put(payload, comm_size, 10.0);
       XBT_INFO("Send to %s completed", mailbox->get_cname());
-    } catch (simgrid::TimeoutError& e) {
+    } catch (const simgrid::TimeoutError&) {
       delete payload;
       XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
     } catch (xbt_ex& e) {
@@ -58,7 +58,7 @@ static int master(int argc, char* argv[])
     double* payload = new double(-1.0);
     try {
       mailbox->put(payload, 0, 1.0);
-    } catch (simgrid::TimeoutError& e) {
+    } catch (const simgrid::TimeoutError&) {
       delete payload;
       XBT_INFO("Mmh. Got timeouted while speaking to '%s'. Nevermind. Let's keep going!", mailbox->get_cname());
     } catch (xbt_ex& e) {
index 911f950..fd526d1 100644 (file)
@@ -53,13 +53,13 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 
   try {
     this->num_groups_ = std::stoi(tmp[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
   }
 
   try {
     this->num_links_blue_ = std::stoi(tmp[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of links for the blue level:") + tmp[1]);
   }
   // Black network : number of chassis/group, number of links between each router on the black network
@@ -70,13 +70,13 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 
   try {
     this->num_chassis_per_group_ = std::stoi(tmp[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
   }
 
   try {
     this->num_links_black_ = std::stoi(tmp[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of links for the black level:") + tmp[1]);
   }
 
@@ -88,20 +88,20 @@ void DragonflyZone::parse_specific_arguments(ClusterCreationArgs* cluster)
 
   try {
     this->num_blades_per_chassis_ = std::stoi(tmp[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of groups:") + tmp[0]);
   }
 
   try {
     this->num_links_green_ = std::stoi(tmp[1]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Invalid number of links for the green level:") + tmp[1]);
   }
 
   // The last part of topo_parameters should be the number of nodes per blade
   try {
     this->num_nodes_per_blade_ = std::stoi(parameters[3]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Last parameter is not the amount of nodes per blade:") + parameters[3]);
   }
 
index ae1556c..d8b6e50 100644 (file)
@@ -373,7 +373,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   // The first parts of topo_parameters should be the levels number
   try {
     this->levels_ = std::stoi(parameters[0]);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("First parameter is not the amount of levels:") + parameters[0]);
   }
 
@@ -385,7 +385,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   for (size_t i = 0; i < tmp.size(); i++) {
     try {
       this->num_children_per_node_.push_back(std::stoi(tmp[i]));
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid lower level node number:") + tmp[i]);
     }
   }
@@ -398,7 +398,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   for (size_t i = 0; i < tmp.size(); i++) {
     try {
       this->num_parents_per_node_.push_back(std::stoi(tmp[i]));
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid upper level node number:") + tmp[i]);
     }
   }
@@ -411,7 +411,7 @@ void FatTreeZone::parse_specific_arguments(ClusterCreationArgs* cluster)
   for (size_t i = 0; i < tmp.size(); i++) {
     try {
       this->num_port_lower_level_.push_back(std::stoi(tmp[i]));
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid lower level port number:") + tmp[i]);
     }
   }
index e8c0ca8..d491627 100644 (file)
@@ -59,11 +59,11 @@ int main(int argc, char** argv)
     int res = SIMGRID_MC_EXIT_SUCCESS;
     try {
       checker->run();
-    } catch (simgrid::mc::DeadlockError& de) {
+    } catch (const simgrid::mc::DeadlockError&) {
       res = SIMGRID_MC_EXIT_DEADLOCK;
-    } catch (simgrid::mc::TerminationError& te) {
+    } catch (const simgrid::mc::TerminationError&) {
       res = SIMGRID_MC_EXIT_NON_TERMINATION;
-    } catch (simgrid::mc::LivenessError& le) {
+    } catch (const simgrid::mc::LivenessError&) {
       res = SIMGRID_MC_EXIT_LIVENESS;
     }
     checker = nullptr;
index 28db1e5..d9bdac3 100644 (file)
@@ -28,10 +28,10 @@ bool Comm::test()
       /* I am the receiver */
       (*task_received)->set_not_used();
     }
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     status_  = MSG_TIMEOUT;
     finished = true;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException&) {
     status_  = MSG_TASK_CANCELED;
     finished = true;
   } catch (xbt_ex& e) {
@@ -56,9 +56,9 @@ msg_error_t Comm::wait_for(double timeout)
     }
 
     /* FIXME: these functions are not traceable */
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     status_ = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException&) {
     status_ = MSG_TASK_CANCELED;
   } catch (xbt_ex& e) {
     if (e.category == network_error)
index fd4562c..9cedca5 100644 (file)
@@ -130,7 +130,7 @@ msg_error_t MSG_process_sleep(double duration)
   try {
     sg_actor_sleep_for(duration);
     return MSG_OK;
-  } catch (simgrid::HostFailureException& e) {
+  } catch (const simgrid::HostFailureException&) {
     return MSG_HOST_FAILURE;
   }
 }
index 08aeb1f..9094468 100644 (file)
@@ -81,11 +81,11 @@ msg_error_t Task::execute()
 
     set_not_used();
     XBT_DEBUG("Execution task '%s' finished", get_cname());
-  } catch (HostFailureException& e) {
+  } catch (const HostFailureException&) {
     status = MSG_HOST_FAILURE;
-  } catch (TimeoutError& e) {
+  } catch (const TimeoutError&) {
     status = MSG_TIMEOUT;
-  } catch (CancelException& e) {
+  } catch (const CancelException&) {
     status = MSG_TASK_CANCELED;
   }
 
@@ -133,9 +133,9 @@ msg_error_t Task::send(const std::string& alias, double timeout)
     s4u::CommPtr s4u_comm = send_async(alias, nullptr, false);
     comm                  = s4u_comm;
     comm->wait_for(timeout);
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     ret = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException&) {
     ret = MSG_HOST_FAILURE;
   } catch (xbt_ex& e) {
     if (e.category == network_error)
@@ -625,11 +625,11 @@ msg_error_t MSG_task_receive_ext_bounded(msg_task_t* task, const char* alias, do
     *task = static_cast<msg_task_t>(payload);
     XBT_DEBUG("Got task %s from %s", (*task)->get_cname(), alias);
     (*task)->set_not_used();
-  } catch (simgrid::HostFailureException& e) {
+  } catch (const simgrid::HostFailureException&) {
     ret = MSG_HOST_FAILURE;
-  } catch (simgrid::TimeoutError& e) {
+  } catch (const simgrid::TimeoutError&) {
     ret = MSG_TIMEOUT;
-  } catch (simgrid::CancelException& e) {
+  } catch (const simgrid::CancelException&) {
     ret = MSG_TASK_CANCELED;
   } catch (xbt_ex& e) {
     if (e.category == network_error)
index f380c16..125a8c8 100644 (file)
@@ -203,7 +203,7 @@ HostEnergy::HostEnergy(simgrid::s4u::Host* ptr) : host_(ptr), last_updated_(surf
   if (off_power_str != nullptr) {
     try {
       this->watts_off_ = std::stod(std::string(off_power_str));
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid value for property watt_off of host ") + host_->get_cname() +
                                   ": " + off_power_str);
     }
index ea5cf2d..d6ff797 100644 (file)
@@ -107,13 +107,13 @@ void LinkEnergy::init_watts_range_list()
     /* max_power is the power consumed at 100% link load       */
     try {
       idle_ = std::stod(current_power_values.front());
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid idle power value for link ") + this->link_->get_cname());
     }
 
     try {
       busy_ = std::stod(current_power_values.back());
-    } catch (std::invalid_argument& ia) {
+    } catch (const std::invalid_argument&) {
       throw std::invalid_argument(std::string("Invalid busy power value for link ") + this->link_->get_cname());
     }
   }
index 3ef63ed..460e9f4 100644 (file)
@@ -107,7 +107,7 @@ sg_size_t MigrationTx::sendMigrationData(sg_size_t size, int stage, int stage2_r
       comm = mbox->put_init(msg, size)->set_rate(mig_speed)->wait_for(timeout);
     else
       comm = mbox->put_async(msg, size)->wait_for(timeout);
-  } catch (xbt_ex& e) {
+  } catch (const xbt_ex&) {
     if (comm) {
       sg_size_t remaining = static_cast<sg_size_t>(comm->get_remaining());
       XBT_VERB("timeout (%lf s) in sending_migration_data, remaining %llu bytes of %llu", timeout, remaining, size);
@@ -182,7 +182,7 @@ void MigrationTx::operator()()
     } else if (sent > ramsize)
       XBT_CRITICAL("bug");
 
-  } catch (xbt_ex& e) {
+  } catch (const xbt_ex&) {
     // hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data code)
     // Stop the dirty page tracking an return (there is no memory space to release)
     sg_vm_stop_dirty_page_tracking(vm_);
@@ -222,7 +222,7 @@ void MigrationTx::operator()()
       try {
         XBT_DEBUG("Stage 2, gonna send %llu", updated_size);
         sent = sendMigrationData(updated_size, 2, stage2_round, mig_speed, mig_timeout);
-      } catch (xbt_ex& e) {
+      } catch (const xbt_ex&) {
         // hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data
         // code)
         // Stop the dirty page tracking an return (there is no memory space to release)
@@ -266,7 +266,7 @@ void MigrationTx::operator()()
   try {
     XBT_DEBUG("Stage 3: Gonna send %zu bytes", remaining_size);
     sendMigrationData(remaining_size, 3, 0, mig_speed, -1);
-  } catch (xbt_ex& e) {
+  } catch (const xbt_ex&) {
     // hostfailure (if you want to know whether this is the SRC or the DST check directly in send_migration_data code)
     // Stop the dirty page tracking an return (there is no memory space to release)
     vm_->resume();
index 82f8d0d..0c59e70 100644 (file)
@@ -237,7 +237,7 @@ void STag_dax__adag()
   try {
     double version = std::stod(std::string(A_dax__adag_version));
     xbt_assert(version == 2.1, "Expected version 2.1 in <adag> tag, got %f. Fix the parser or your file", version);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Parse error: ") + A_dax__adag_version + " is not a double");
   }
 }
@@ -253,7 +253,7 @@ void STag_dax__job()
     current_job = SD_task_create_comp_seq(name.c_str(), nullptr, runtime);
     jobs.insert({A_dax__job_id, current_job});
     xbt_dynar_push(result, &current_job);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Parse error: ") + A_dax__job_runtime + " is not a double");
   }
 }
@@ -263,7 +263,7 @@ void STag_dax__uses()
   double size;
   try {
     size = std::stod(std::string(A_dax__uses_size));
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     throw std::invalid_argument(std::string("Parse error: ") + A_dax__uses_size + " is not a double");
   }
   bool is_input = (A_dax__uses_link == A_dax__uses_link_input);
index f79f6c3..2f2ff22 100644 (file)
@@ -48,8 +48,7 @@ void SIMIX_launch_application(const std::string& file)
     parse_status = surf_parse();
     surf_parse_close();
     xbt_assert(not parse_status, "Parse error at %s:%d", file.c_str(), surf_parse_lineno);
-  }
-  catch (xbt_ex& e) {
+  } catch (const xbt_ex&) {
     XBT_ERROR(
         "Unrecoverable error at %s:%d. The full exception stack follows, in case it helps you to diagnose the problem.",
         file.c_str(), surf_parse_lineno);
index ae8df44..7e029ad 100644 (file)
@@ -43,14 +43,14 @@ std::vector<s_smpi_factor_t> parse_factor(const std::string& smpi_coef_string)
       if (factor_iter == factor_values.begin()) { /* first element */
         try {
           fact.factor = std::stoi(*factor_iter);
-        } catch (std::invalid_argument& ia) {
+        } catch (const std::invalid_argument&) {
           throw std::invalid_argument(std::string("Invalid factor in chunk ") + std::to_string(smpi_factor.size() + 1) +
                                       ": " + *factor_iter);
         }
       } else {
         try {
           fact.values.push_back(surf_parse_get_time((*factor_iter).c_str(), "smpi factor", ""));
-        } catch (std::invalid_argument& ia) {
+        } catch (const std::invalid_argument&) {
           throw std::invalid_argument(std::string("Invalid factor value ") + std::to_string(iteration) + " in chunk " +
                                       std::to_string(smpi_factor.size() + 1) + ": " + *factor_iter);
         }
index 4a54f6a..85a9497 100644 (file)
@@ -548,7 +548,7 @@ int Request::test(MPI_Request * request, MPI_Status * status, int* flag) {
     if ((*request)->action_ != nullptr){
       try{
         *flag = simcall_comm_test((*request)->action_);
-      }catch (xbt_ex& e) {
+      } catch (const xbt_ex&) {
         *flag = 0;
         return ret;
       }
@@ -639,7 +639,7 @@ int Request::testany(int count, MPI_Request requests[], int *index, int* flag, M
       simcall_process_sleep(nsleeps*smpi_test_sleep);
     try{
       i = simcall_comm_testany(comms.data(), comms.size()); // The i-th element in comms matches!
-    }catch (xbt_ex& e) {
+    } catch (const xbt_ex&) {
       return 0;
     }
     
@@ -901,7 +901,7 @@ int Request::wait(MPI_Request * request, MPI_Status * status)
       try{
         // this is not a detached send
         simcall_comm_wait((*request)->action_, -1.0);
-      }catch (xbt_ex& e) {
+      } catch (const xbt_ex&) {
         XBT_VERB("Request cancelled");
       }
   }
@@ -964,8 +964,8 @@ int Request::waitany(int count, MPI_Request requests[], MPI_Status * status)
       try{
         // this is not a detached send
         i = simcall_comm_waitany(comms.data(), comms.size(), -1);
-      }catch (xbt_ex& e) {
-      XBT_INFO("request %d cancelled ",i);
+      } catch (const xbt_ex&) {
+        XBT_INFO("request %d cancelled ", i);
         return i;
       }
 
index ef5aa09..811474e 100644 (file)
@@ -86,7 +86,7 @@ double surf_parse_get_double(const std::string& s)
 {
   try {
     return std::stod(s);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     surf_parse_error(s + " is not a double");
   }
 }
@@ -95,7 +95,7 @@ int surf_parse_get_int(const std::string& s)
 {
   try {
     return std::stoi(s);
-  } catch (std::invalid_argument& ia) {
+  } catch (const std::invalid_argument&) {
     surf_parse_error(s + " is not a double");
   }
 }
index 82b64ee..beec1e4 100644 (file)
@@ -145,7 +145,7 @@ static void handler()
     std::abort();
   }
 
-  catch (simgrid::ForcefulKillException const& e) {
+  catch (const simgrid::ForcefulKillException&) {
     XBT_ERROR("Received a ForcefulKillException at the top-level exception handler. Maybe a Java->C++ call that is not "
               "protected "
               "in a try/catch?");
index a3c143f..2dce6b2 100644 (file)
@@ -39,8 +39,7 @@ uintptr_t eval_binary_operation(
 
   try {
     simgrid::dwarf::execute(ops, 3, state, stack);
-  }
-  catch(std::runtime_error& e) {
+  } catch (const std::runtime_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
 
@@ -63,7 +62,7 @@ void basic_test(simgrid::dwarf::ExpressionContext const& state) {
   try {
     ops[0].atom = DW_OP_drop;
     simgrid::dwarf::execute(ops, 1, state, stack);
-  } catch (simgrid::dwarf::evaluation_error& e) {
+  } catch (const simgrid::dwarf::evaluation_error&) {
     caught_ex = true;
   }
   if (not caught_ex)
@@ -125,8 +124,7 @@ void basic_test(simgrid::dwarf::ExpressionContext const& state) {
   assert(stack.top()  == a);
   assert(stack.top(1) == b);
 
-  }
-  catch(std::runtime_error& e) {
+  } catch (const std::runtime_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
 }
@@ -148,8 +146,7 @@ void test_deref(simgrid::dwarf::ExpressionContext const& state) {
   assert(stack.size() == 1);
   assert(stack.top()  == foo);
 
-  }
-  catch(std::runtime_error& e) {
+  } catch (const std::runtime_error&) {
     fprintf(stderr,"Expression evaluation error");
   }
 }
index 847ff6c..1220c58 100644 (file)
@@ -77,7 +77,7 @@ int main(int argc, char**argv)
     mfree(heapA, pointers[i]);
     try {
       mfree(heapA, pointers[i]);
-    } catch(xbt_ex& e) {
+    } catch (const xbt_ex&) {
       gotit = true;
     }
     if (not gotit)
@@ -89,7 +89,7 @@ int main(int argc, char**argv)
     bool gotit = false;
     try {
       mfree(heapA, pointers[i]);
-    } catch(xbt_ex& e) {
+    } catch (const xbt_ex&) {
       gotit = true;
     }
     if (not gotit)