From e3771caa277bcafe6b67c9bfaf18ab8ee70001a7 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Wed, 24 Jul 2019 18:04:51 +0200 Subject: [PATCH 1/1] [cppcheck] Reduce scope for variable. --- src/smpi/mpi/smpi_comm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/smpi/mpi/smpi_comm.cpp b/src/smpi/mpi/smpi_comm.cpp index 1ecccf4610..8571f381b4 100644 --- a/src/smpi/mpi/smpi_comm.cpp +++ b/src/smpi/mpi/smpi_comm.cpp @@ -40,11 +40,11 @@ Comm::Comm(MPI_Group group, MPI_Topology topo, int smp, int in_id) : group_(grou is_blocked_ = 0; info_ = MPI_INFO_NULL; errhandler_ = MPI_ERRORS_ARE_FATAL; - static int global_id_=0; //First creation of comm is done before SIMIX_run, so only do comms for others if(in_id==MPI_UNDEFINED && smp==0 && this->rank()!=MPI_UNDEFINED ){ int id; if(this->rank()==0){ + static int global_id_ = 0; id=global_id_; global_id_++; } -- 2.20.1