Salome HOME
Fight warnings
authorvsr <vsr@opencascade.com>
Mon, 20 Apr 2020 18:01:19 +0000 (18:01 +0000)
committervsr <vsr@opencascade.com>
Wed, 29 Jul 2020 08:31:32 +0000 (11:31 +0300)
21 files changed:
CMakeLists.txt
src/CCC/BatchManager_CCC.cxx
src/COORM/BatchManager_COORM.cxx
src/Core/BatchManager.cxx
src/Core/BatchManagerCatalog.hxx
src/Core/CommunicationProtocolSH.cxx
src/Core/Constants.hxx
src/Core/Log.hxx
src/Core/MpiImpl.cxx
src/Core/ParameterTypeMap.hxx
src/Core/Test/SimpleParser.cxx
src/Core/Test/SimpleParser.hxx
src/Core/Test/Test_SimpleParser.cxx
src/Core/Versatile.cxx
src/Core/Versatile.hxx
src/LSF/BatchManager_LSF.cxx
src/Local/BatchManager_Local.cxx
src/OAR/BatchManager_OAR.cxx
src/PBS/BatchManager_PBS.cxx
src/SGE/BatchManager_SGE.cxx
src/Vishnu/BatchManager_Vishnu.cxx

index c89c3541635f045bf1b286fa4f14de30a21fb90c..a120733355b0c0a22bc275055a133585e9126748 100644 (file)
@@ -61,6 +61,45 @@ IF(LIBBATCH_LOCAL_SUBMISSION)
   LIBBATCH_FIND_ALL_LOCAL_COMMANDS()
 ENDIF()
 
+INCLUDE(CheckCXXCompilerFlag)
+
+SET(LIBBATCH_NO_CXX11_SUPPORT FALSE CACHE BOOL "Switch OFF C++-11 standard")
+IF(NOT LIBBATCH_NO_CXX11_SUPPORT)
+  # C++11 support
+  CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
+  IF(COMPILER_SUPPORTS_CXX11)
+    MESSAGE(STATUS "Enable C++11 support")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
+  ELSE()
+    CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
+    IF(COMPILER_SUPPORTS_CXX0X)
+      MESSAGE(STATUS "Enable C++0x support")
+      SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
+    ELSE()
+      MESSAGE(WARNING "Compiler ${CMAKE_CXX_COMPILER} has no C++11 support.")
+    ENDIF()
+  ENDIF()
+ENDIF()
+
+IF(NOT (WIN32 OR APPLE))
+  SET(LIBBATCH_DEBUG_WARNINGS FALSE CACHE BOOL "Print more compiler warnings")
+  SET(LIBBATCH_TREAT_WARNINGS_AS_ERRORS FALSE CACHE BOOL "Treat compiler warnings as errors")
+  IF(LIBBATCH_DEBUG_WARNINGS)
+    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wpedantic")
+  ENDIF()
+  IF(LIBBATCH_TREAT_WARNINGS_AS_ERRORS)
+    SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
+  ENDIF()
+ENDIF()
+
+# Compiler flag to disable treating alternative C++ tokens (compatibility with MSVS)
+CHECK_CXX_COMPILER_FLAG("-fno-operator-names" COMPILER_SUPPORTS_NO_OPERATOR_NAMES)
+IF(COMPILER_SUPPORTS_NO_OPERATOR_NAMES)
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-operator-names")
+ENDIF()
+
 # Prerequisites detection:
 # ========================
 FIND_PACKAGE(LibbatchPThread REQUIRED)
index c69d625e7192808e6575d27139577a263929b7a8..7843e40dd5536ab4b5fa5663b28fe0a19b64d1db 100644 (file)
@@ -156,7 +156,7 @@ namespace Batch {
 
 
   // Methode pour le controle des jobs : teste si un job est present en machine
-  bool BatchManager_CCC::isRunning(const JobId & jobid)
+  bool BatchManager_CCC::isRunning(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("BatchManager_CCC::isRunning");
   }
index 5676073a905b72b14157ce04f541c11ee5370320..9fbbabd8ae5b53c2449ac47615f83e52f5c75536 100644 (file)
@@ -179,6 +179,9 @@ namespace Batch
         int edt                 = 0;
         int mem              = 0;
         string queue         = "";
+        LIBBATCH_UNUSED(nbproc);
+        LIBBATCH_UNUSED(edt);
+        LIBBATCH_UNUSED(mem);
 
         // Mandatory parameters
         if (params.find(WORKDIR) != params.end())
index 10a1e981185707383b7ff2e6feb68571d6211c83..3af9e2e7af4e2992ba8fe7f2474b018fd587cf0d 100644 (file)
@@ -84,48 +84,48 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : retire un job du gestionnaire
-  void BatchManager::deleteJob(const JobId & jobid)
+  void BatchManager::deleteJob(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("Method deleteJob not implemented by Batch Manager \"" + _type + "\"");
   }
 
   // Methode pour le controle des jobs : suspend un job en file d'attente
-  void BatchManager::holdJob(const JobId & jobid)
+  void BatchManager::holdJob(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("Method holdJob not implemented by Batch Manager \"" + _type + "\"");
   }
 
   // Methode pour le controle des jobs : relache un job suspendu
-  void BatchManager::releaseJob(const JobId & jobid)
+  void BatchManager::releaseJob(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("Method releaseJob not implemented by Batch Manager \"" + _type + "\"");
   }
 
   // Methode pour le controle des jobs : modifie un job en file d'attente
-  void BatchManager::alterJob(const JobId & jobid, const Parametre & param, const Environnement & env)
+  void BatchManager::alterJob(const JobId & /*jobid*/, const Parametre & /*param*/, const Environnement & /*env*/)
   {
     throw NotYetImplementedException("Method alterJob not implemented by Batch Manager \"" + _type + "\"");
   }
 
   // Methode pour le controle des jobs : modifie un job en file d'attente
-  void BatchManager::alterJob(const JobId & jobid, const Parametre & param)
+  void BatchManager::alterJob(const JobId & /*jobid*/, const Parametre & /*param*/)
   {
     throw NotYetImplementedException("Method alterJob not implemented by Batch Manager \"" + _type + "\"");
   }
 
   // Methode pour le controle des jobs : modifie un job en file d'attente
-  void BatchManager::alterJob(const JobId & jobid, const Environnement & env)
+  void BatchManager::alterJob(const JobId & /*jobid*/, const Environnement & /*env*/)
   {
     throw NotYetImplementedException("Method alterJob not implemented by Batch Manager \"" + _type + "\"");
   }
 
   // Methode pour le controle des jobs : renvoie l'etat du job
-  JobInfo BatchManager::queryJob(const JobId & jobid)
+  JobInfo BatchManager::queryJob(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("Method queryJob not implemented by Batch Manager \"" + _type + "\"");
   }
 
-  const JobId BatchManager::addJob(const Job & job, const string & reference)
+  const JobId BatchManager::addJob(const Job & /*job*/, const string & reference)
   {
     return JobId(this, reference);
   }
@@ -390,7 +390,7 @@ namespace Batch {
     }
   }
   
-  const Batch::JobId BatchManager::runJob(const Batch::Job & job)
+  const Batch::JobId BatchManager::runJob(const Batch::Job & /*job*/)
   {
     throw NotYetImplementedException("Method runJob not implemented by Batch Manager \"" + _type + "\"");
   }
index 63b6b215b1b3ca3d1a70f4dce03f3f60dd5a578c..4e7803d55655aa8e90ac14e0c2b4f4c84c2b44b2 100644 (file)
@@ -66,8 +66,8 @@ namespace Batch {
   private:
 
     // Forbid the use of copy constructor and assignment operator
-    BatchManagerCatalog(const BatchManagerCatalog & orig) {}
-    void operator=(const BatchManagerCatalog & orig) {}
+    BatchManagerCatalog(const BatchManagerCatalog &) {}
+    void operator=(const BatchManagerCatalog &) {}
 
   };
 
index 4f55ac5d51507c6112076ff83c10e5ab073cad95..2822b9d1d11ecfc2110e2134575b14f54ecef0e8 100644 (file)
@@ -41,8 +41,8 @@ namespace Batch {
   }
 
   vector<string> CommunicationProtocolSH::getExecCommandArgs(const string & subCommand,
-                                                             const string & host,
-                                                             const string & user) const
+                                                             const string & /*host*/,
+                                                             const string & /*user*/) const
   {
     vector<string> cmd;
 
@@ -60,11 +60,11 @@ namespace Batch {
   }
 
   vector<string> CommunicationProtocolSH::getCopyCommandArgs(const string & sourcePath,
-                                                             const string & sourceHost,
-                                                             const string & sourceUser,
+                                                             const string & /*sourceHost*/,
+                                                             const string & /*sourceUser*/,
                                                              const string & destinationPath,
-                                                             const string & destinationHost,
-                                                             const string & destinationUser) const
+                                                             const string & /*destinationHost*/,
+                                                             const string & /*destinationUser*/) const
   {
     vector<string> cmd;
     cmd.push_back(CP_COMMAND);
index 591f248e2c3715624dd44965dbd2a40ad75f45ec..b29fdc4f1fc9ce42a66b0b4602d252508b65a538 100644 (file)
@@ -39,6 +39,7 @@
 // TODO: replace those static declarations by an external description file (XML for instance)
 #define decl_extern_Constant(constant) extern BATCH_EXPORT const std::string constant
 #define def_Constant(constant) const std::string constant = #constant
+#define LIBBATCH_UNUSED(var) (void)var
 
 namespace Batch {
 
index 21b89eb9b526811dc1273b20745c86226ec1fd7b..47245dc7cc10fc339f6161840c28e2e958d12137 100644 (file)
@@ -53,8 +53,8 @@ namespace Batch {
     static Log & getInstance();
 
     // Forbid the use of copy constructor and assignment operator
-    Log(const Log & orig) {}
-    void operator=(const Log & orig) {}
+    Log(const Log &) {}
+    void operator=(const Log &) {}
 
     std::ofstream _stream;
 
index 13650c438edc736f65ddaaf4a9332fa43606b29b..9cb46d4ff270170ac524c41566b5473d10e7eed4 100644 (file)
@@ -58,14 +58,14 @@ string MpiImpl_LAM::rank()
   return "${LAMRANK}";
 }
 
-string MpiImpl_LAM::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_LAM::boot(const string machinefile, const unsigned int /*nbnodes*/)
 {
   ostringstream oss;
   oss << "lamboot " << machinefile << endl;
   return oss.str();
 }
 
-string MpiImpl_LAM::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_LAM::run(const string /*machinefile*/, const unsigned int nbproc, const string fileNameToExecute)
 {
   ostringstream oss;
   oss << "mpirun -np " << nbproc << " " << fileNameToExecute << endl;
@@ -105,7 +105,7 @@ string MpiImpl_MPICH1::rank()
   return "${MPIRUN_RANK}";
 }
 
-string MpiImpl_MPICH1::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_MPICH1::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
 {
   return "";
 }
@@ -158,7 +158,7 @@ string MpiImpl_MPICH2::boot(const string machinefile, const unsigned int nbnodes
   return oss.str();
 }
 
-string MpiImpl_MPICH2::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_MPICH2::run(const string /*machinefile*/, const unsigned int nbproc, const string fileNameToExecute)
 {
   ostringstream oss;
   oss << "mpirun -np " << nbproc << " " << fileNameToExecute << endl;
@@ -198,7 +198,7 @@ string MpiImpl_OPENMPI::rank()
   return "${OMPI_MCA_ns_nds_vpid}";
 }
 
-string MpiImpl_OPENMPI::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_OPENMPI::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
 {
   return "";
 }
@@ -241,7 +241,7 @@ string MpiImpl_OMPI::rank()
   return "${OMPI_MCA_ns_nds_vpid}";
 }
 
-string MpiImpl_OMPI::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_OMPI::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
 {
   return "";
 }
@@ -284,12 +284,12 @@ string MpiImpl_SLURM::rank()
   return "${SLURM_PROCID}";
 }
 
-string MpiImpl_SLURM::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_SLURM::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
 {
   return "";
 }
 
-string MpiImpl_SLURM::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_SLURM::run(const string /*machinefile*/, const unsigned int /*nbproc*/, const string fileNameToExecute)
 {
   ostringstream oss;
   oss << "srun " << fileNameToExecute << endl;
@@ -327,12 +327,12 @@ string MpiImpl_PRUN::rank()
   return "${RMS_RANK}";
 }
 
-string MpiImpl_PRUN::boot(const string machinefile, const unsigned int nbnodes)
+string MpiImpl_PRUN::boot(const string /*machinefile*/, const unsigned int /*nbnodes*/)
 {
   return "";
 }
 
-string MpiImpl_PRUN::run(const string machinefile, const unsigned int nbproc, const string fileNameToExecute)
+string MpiImpl_PRUN::run(const string /*machinefile*/, const unsigned int nbproc, const string fileNameToExecute)
 {
   ostringstream oss;
   oss << "prun -n " << nbproc << " " << "-p mpi " << fileNameToExecute << endl;
index 29d1ac7948042388a75b8fe461fd006c34d8f414..d2ccf72b63a9df39033edddace7bcd21f928f203 100644 (file)
@@ -67,8 +67,8 @@ namespace Batch {
   private:
 
     // Forbid the use of copy constructor and assignment operator
-    ParameterTypeMap(const ParameterTypeMap & orig) {}
-    void operator=(const ParameterTypeMap & orig) {}
+    ParameterTypeMap(const ParameterTypeMap &) {}
+    void operator=(const ParameterTypeMap &) {}
 
   };
 
index 28360fd3a55f50e66b32779acb539e6f9195c122..343469dd96f6e43ff82e2cca06d45bf28bbd7736 100644 (file)
 using namespace std;
 
 
-ParserException::ParserException(string msg) throw()
+ParserException::ParserException(string msg) noexcept
   : exception(),
     _msg(msg)
 {
 }
 
-ParserException::~ParserException() throw()
+ParserException::~ParserException() noexcept
 {
 }
 
-const char * ParserException::what() const throw()
+const char * ParserException::what() const noexcept
 {
   return _msg.c_str();
 }
 
 
-SimpleParser::SimpleParser() throw()
+SimpleParser::SimpleParser() noexcept
 {
 }
 
-SimpleParser::~SimpleParser() throw()
+SimpleParser::~SimpleParser() noexcept
 {
 }
 
-std::string SimpleParser::trim(const std::string & str) const throw()
+std::string SimpleParser::trim(const std::string & str) const noexcept
 {
   size_t beg = str.find_first_not_of(" \t");
   if (beg == string::npos) beg = 0;
@@ -70,7 +70,7 @@ std::string SimpleParser::trim(const std::string & str) const throw()
   return str.substr(beg, end-beg+1);
 }
 
-void SimpleParser::parse(const string & filename) throw(ParserException)
+void SimpleParser::parse(const string & filename)
 {
   ifstream fileStream(filename.c_str());
   if (!fileStream) {
@@ -109,7 +109,7 @@ void SimpleParser::parse(const string & filename) throw(ParserException)
   fileStream.close();
 }
 
-void SimpleParser::parseTestConfigFile() throw(ParserException)
+void SimpleParser::parseTestConfigFile()
 {
   char * filename = getenv(TEST_CONFIG_FILE_ENV_VAR);
   if (filename == NULL) {
@@ -119,7 +119,7 @@ void SimpleParser::parseTestConfigFile() throw(ParserException)
   }
 }
 
-const string & SimpleParser::getValue(const string & key) const throw(ParserException)
+const string & SimpleParser::getValue(const string & key) const
 {
   map<string,string>::const_iterator iter = _configmap.find(key);
   if (iter == _configmap.end()) {
@@ -129,7 +129,7 @@ const string & SimpleParser::getValue(const string & key) const throw(ParserExce
 }
 
 const string & SimpleParser::getTestValue(const string & bmType, const string & protocolStr,
-                                          const string & key) const throw(ParserException)
+                                          const string & key) const
 {
   string fullkey = string("TEST_") + bmType + "_" + protocolStr + "_" + key;
   try {
@@ -143,7 +143,7 @@ const string & SimpleParser::getTestValue(const string & bmType, const string &
   return getValue(fullkey);
 }
 
-int SimpleParser::getValueAsInt(const string & key) const throw(ParserException)
+int SimpleParser::getValueAsInt(const string & key) const
 {
   const string & valueStr = getValue(key);
   const char * valueCStr = valueStr.c_str();
@@ -156,7 +156,7 @@ int SimpleParser::getValueAsInt(const string & key) const throw(ParserException)
 }
 
 int SimpleParser::getTestValueAsInt(const string & bmType, const string & protocolStr,
-                                    const string & key) const throw(ParserException)
+                                    const string & key) const
 {
   string fullkey = string("TEST_") + bmType + "_" + protocolStr + "_" + key;
   try {
@@ -170,7 +170,7 @@ int SimpleParser::getTestValueAsInt(const string & bmType, const string & protoc
   return getValueAsInt(fullkey);
 }
 
-ostream & operator <<(ostream & os, const SimpleParser & parser) throw()
+ostream & operator <<(ostream & os, const SimpleParser & parser) noexcept
 {
   if (parser._configmap.empty()) {
     os << "Empty map" << endl;
index ec0f0b02d34c5ff9f74e2f7ca1373cc2e8d580e3..fb314249f388c296b6355859be6831597a10aad5 100644 (file)
 class ParserException : public std::exception
 {
 public:
-  ParserException(std::string msg) throw();
-  virtual ~ParserException() throw();
+  ParserException(std::string msg) noexcept;
+  virtual ~ParserException() noexcept;
 
-  virtual const char *what() const throw();
+  virtual const char *what() const noexcept;
 
 private:
   std::string _msg;
@@ -48,22 +48,22 @@ private:
 class SimpleParser
 {
 public:
-  SimpleParser() throw();
-  virtual ~SimpleParser() throw();
+  SimpleParser() noexcept;
+  virtual ~SimpleParser() noexcept;
 
-  void parse(const std::string & filename) throw(ParserException);
-  void parseTestConfigFile() throw(ParserException);
-  const std::string & getValue(const std::string & key) const throw(ParserException);
+  void parse(const std::string & filename);
+  void parseTestConfigFile();
+  const std::string & getValue(const std::string & key) const;
   const std::string & getTestValue(const std::string & bmType, const std::string & protocolStr,
-                                   const std::string & key) const throw(ParserException);
-  int getValueAsInt(const std::string & key) const throw(ParserException);
+                                   const std::string & key) const;
+  int getValueAsInt(const std::string & key) const;
   int getTestValueAsInt(const std::string & bmType, const std::string & protocolStr,
-                        const std::string & key) const throw(ParserException);
+                        const std::string & key) const;
 
-  friend std::ostream & operator <<(std::ostream & os, const SimpleParser & parser) throw();
+  friend std::ostream & operator <<(std::ostream & os, const SimpleParser & parser) noexcept;
 
 private:
-  std::string trim(const std::string & str) const throw();
+  std::string trim(const std::string & str) const noexcept;
 
   std::map<std::string, std::string> _configmap;
 };
index f635e42208af4a678335d62449d23b3acdb22719..e10403a0284dbb8307f1b143cf305ca733b04749 100644 (file)
@@ -35,7 +35,7 @@
 
 using namespace std;
 
-int main(int argc, char** argv)
+int main(int /*argc*/, char** /*argv*/)
 {
   cout << "*******************************************************************************************" << endl;
   cout << "This program tests the simple parser that parses the configuration file used in the other" << endl;
@@ -49,7 +49,7 @@ int main(int argc, char** argv)
   try {
     // Parse the configuration file
     parser.parseTestConfigFile();
-  } catch (ParserException e) {
+  } catch (const ParserException& e) {
     cerr << "Parser error: " << e.what() << endl;
     return 1;
   }
index 010849bb62deec0487cd1e6ec0a47c22ffae8d35..ff85ba28d097a4c3f2cf4db1223376134703260f 100644 (file)
@@ -52,9 +52,10 @@ namespace Batch {
   }
 
   Versatile::Versatile(const Versatile & V)
-   : _discriminator(V._discriminator),
-     _maxsize(V._maxsize),
-     _name(V._name)
+    : list(),
+      _discriminator(V._discriminator),
+      _maxsize(V._maxsize),
+      _name(V._name)
   {
     Versatile::const_iterator it;
     for(it=V.begin(); it!=V.end(); it++)
@@ -66,7 +67,7 @@ namespace Batch {
     eraseAll();
   }
 
-  Versatile & Versatile::operator = (const long l) throw(TypeMismatchException)
+  Versatile & Versatile::operator = (const long l)
   {
     checkType(LONG);
     eraseAll();
@@ -74,7 +75,7 @@ namespace Batch {
     return *this;
   }
 
-  Versatile & Versatile::operator = (const string & ch) throw(TypeMismatchException)
+  Versatile & Versatile::operator = (const string & ch)
   {
     checkType(STRING);
     eraseAll();
@@ -82,7 +83,7 @@ namespace Batch {
     return *this;
   }
 
-  Versatile & Versatile::operator +=(const string & ch) throw(TypeMismatchException,ListIsFullException)
+  Versatile & Versatile::operator +=(const string & ch)
   {
     checkType(STRING);
 
@@ -97,28 +98,28 @@ namespace Batch {
     return *this;
   }
 
-  Versatile & Versatile::operator , (const string & ch) throw(TypeMismatchException,ListIsFullException)
+  Versatile & Versatile::operator , (const string & ch)
   {
     *this += ch;
     return *this;
   }
 
-  Versatile & Versatile::operator = (const char * ch) throw(TypeMismatchException)
+  Versatile & Versatile::operator = (const char * ch)
   {
     return operator=(string(ch));
   }
 
-  Versatile & Versatile::operator +=(const char * ch) throw(TypeMismatchException,ListIsFullException)
+  Versatile & Versatile::operator +=(const char * ch)
   {
     return operator+=(string(ch));
   }
 
-  Versatile & Versatile::operator , (const char * ch) throw(TypeMismatchException,ListIsFullException)
+  Versatile & Versatile::operator , (const char * ch)
   {
     return operator,(string(ch));
   }
 
-  Versatile & Versatile::operator = (const Couple & cp) throw(TypeMismatchException)
+  Versatile & Versatile::operator = (const Couple & cp)
   {
     checkType(COUPLE);
     eraseAll();
@@ -126,7 +127,7 @@ namespace Batch {
     return *this;
   }
 
-  Versatile & Versatile::operator +=(const Couple & cp) throw(TypeMismatchException,ListIsFullException)
+  Versatile & Versatile::operator +=(const Couple & cp)
   {
     checkType(COUPLE);
     // If max size is reached, throw a ListIsFullException
@@ -140,7 +141,7 @@ namespace Batch {
     return *this;
   }
 
-  Versatile & Versatile::operator , (const Couple & cp) throw(TypeMismatchException,ListIsFullException)
+  Versatile & Versatile::operator , (const Couple & cp)
   {
     *this += cp;
     return *this;
@@ -158,7 +159,7 @@ namespace Batch {
     return os;
   }
 
-  Versatile & Versatile::operator = (const int i) throw(TypeMismatchException)
+  Versatile & Versatile::operator = (const int i)
   {
     checkType(LONG);
     eraseAll();
@@ -166,7 +167,7 @@ namespace Batch {
     return *this;
   }
 
-  Versatile & Versatile::operator = (const bool b) throw(TypeMismatchException)
+  Versatile & Versatile::operator = (const bool b)
   {
     checkType(BOOL);
     eraseAll();
@@ -174,13 +175,13 @@ namespace Batch {
     return *this;
   }
 
-  void Versatile::checkType(DiscriminatorType t) const throw(TypeMismatchException)
+  void Versatile::checkType(DiscriminatorType t) const
   {
     if (_discriminator != t)
       throw (TypeMismatchException("Trying to change type of Versatile object \"" + _name + "\""));
   }
 
-  Versatile::operator long() const throw(TypeMismatchException)
+  Versatile::operator long() const
   {
     // If the type does not correspond or if the list has more than one element,
     // throw a TypeMismatchException
@@ -192,7 +193,7 @@ namespace Batch {
        return *( static_cast<LongType *>(this->front()) );
   }
 
-  Versatile::operator bool() const throw(TypeMismatchException)
+  Versatile::operator bool() const
   {
     // If the type does not correspond or if the list has more than one element,
     // throw a TypeMismatchException
@@ -204,12 +205,12 @@ namespace Batch {
     return *( static_cast<BoolType *>(this->front()) );
   }
 
-  Versatile::operator int() const throw(TypeMismatchException)
+  Versatile::operator int() const
   {
     return operator long();
   }
 
-  Versatile::operator Couple() const throw(TypeMismatchException)
+  Versatile::operator Couple() const
   {
     // If the type does not correspond or if the list has more than one element,
     // throw a TypeMismatchException
@@ -221,7 +222,7 @@ namespace Batch {
     return *( static_cast<CoupleType *>(this->front()) );
   }
 
-  string Versatile::str() const throw(TypeMismatchException)
+  string Versatile::str() const
   {
     // If the type does not correspond, throw a TypeMismatchException
     if ( _discriminator != STRING || size() == 0 ) {
@@ -240,7 +241,7 @@ namespace Batch {
     return s;
   }
 
-  Versatile::operator string () const throw(TypeMismatchException)
+  Versatile::operator string () const
   {
     return str();
   }
index b5747de0ab1b4b1dd73d4650c642d2e7d886b445..b26fdd10b0004031c1dd153d8ca8b7b7d40f03c1 100644 (file)
@@ -65,32 +65,32 @@ namespace Batch {
     virtual ~Versatile();
 
     // Affectation and concatenation operators from base types
-    Versatile & operator = (const long     l)    throw(TypeMismatchException);
-    Versatile & operator = (const std::string & ch)   throw(TypeMismatchException);
-    Versatile & operator +=(const std::string & ch)   throw(TypeMismatchException,ListIsFullException);
-    Versatile & operator , (const std::string & ch)   throw(TypeMismatchException,ListIsFullException);
-    Versatile & operator = (const char * ch)   throw(TypeMismatchException);
-    Versatile & operator +=(const char * ch)   throw(TypeMismatchException,ListIsFullException);
-    Versatile & operator , (const char * ch)   throw(TypeMismatchException,ListIsFullException);
-    Versatile & operator = (const Couple & cp)   throw(TypeMismatchException);
-    Versatile & operator +=(const Couple & cp)   throw(TypeMismatchException,ListIsFullException);
-    Versatile & operator , (const Couple & cp)   throw(TypeMismatchException,ListIsFullException);
-    Versatile & operator = (const int i) throw(TypeMismatchException);
-    Versatile & operator = (const bool b) throw(TypeMismatchException);
+    Versatile & operator = (const long     l);
+    Versatile & operator = (const std::string & ch);
+    Versatile & operator +=(const std::string & ch);
+    Versatile & operator , (const std::string & ch);
+    Versatile & operator = (const char * ch);
+    Versatile & operator +=(const char * ch);
+    Versatile & operator , (const char * ch);
+    Versatile & operator = (const Couple & cp);
+    Versatile & operator +=(const Couple & cp);
+    Versatile & operator , (const Couple & cp);
+    Versatile & operator = (const int i);
+    Versatile & operator = (const bool b);
 
     // Type conversion to base types
-    operator long() const throw(TypeMismatchException);
-    operator std::string() const throw(TypeMismatchException);
-    operator Couple() const throw(TypeMismatchException);
-    std::string str() const throw(TypeMismatchException);
-    operator bool() const throw(TypeMismatchException);
-    operator int() const throw(TypeMismatchException);
+    operator long() const;
+    operator std::string() const;
+    operator Couple() const;
+    std::string str() const;
+    operator bool() const;
+    operator int() const;
 
     // Display on a stream
     BATCH_EXPORT friend std::ostream & operator << (std::ostream & os, const Versatile & );
 
     // Check the type
-    void checkType(DiscriminatorType t) const throw (TypeMismatchException);
+    void checkType(DiscriminatorType t) const;
 
     // Getter methods
     DiscriminatorType getType() const;
@@ -108,8 +108,8 @@ namespace Batch {
 
   private:
 
-    // Forbid the use of affectation operator
-    void operator= (const Versatile & V) {}
+    // Forbid the use of assignment operator
+    void operator= (const Versatile &) {}
 
   };
 
index f543983bd0db7327df627311add576071e34ede3..646bbca0f538f59edc43b790827fe3d210bea130 100644 (file)
@@ -131,7 +131,7 @@ namespace Batch {
 
 
   // Methode pour le controle des jobs : teste si un job est present en machine
-  bool BatchManager_LSF::isRunning(const JobId & jobid)
+  bool BatchManager_LSF::isRunning(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("BatchManager_LSF::isRunning");
   }
index 6499333c1c3a77a5cb7ebc6832c806ca269356d8..40ba3fe9fd408136fc658339d9e7c64f14efd322 100644 (file)
@@ -225,7 +225,7 @@ namespace Batch {
   // On force donc l'état du job à erreur - pour cela on ne donne pas d'Id
   // au JobId
   const Batch::JobId
-  BatchManager_Local::addJob(const Batch::Job & job, const std::string & reference)
+  BatchManager_Local::addJob(const Batch::Job & /*job*/, const std::string & /*reference*/)
   {
     return JobId(this, "undefined");
   }
index 03e74bcf91c7ae296c5c84f96295a42048de2fda..1391b651c42a00f4dfca7151bd8230dec4e13dff 100644 (file)
@@ -157,6 +157,7 @@ namespace Batch
             mem = params[MAXRAMSIZE];
     if (params.find(QUEUE) != params.end())
             queue = params[QUEUE].str();
+    LIBBATCH_UNUSED(mem);
 
     string::size_type p1 = fileToExecute.find_last_of("/");
     string::size_type p2 = fileToExecute.find_last_of(".");
index 72bf971a42b09a13a7754ce86e4be13ab385ea21..c3cf644074913426921395e91d624e5fd7db5c7e 100644 (file)
@@ -128,7 +128,7 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : teste si un job est present en machine
-  bool BatchManager_PBS::isRunning(const JobId & jobid)
+  bool BatchManager_PBS::isRunning(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("BatchManager_PBS::isRunning");
   }
index 23ad6df4210bd5fe0c0a7739f6c541d818180d11..cfac6d82faa467c288d84df69a3418065735d707 100644 (file)
@@ -147,7 +147,7 @@ namespace Batch {
   }
 
   // Methode pour le controle des jobs : teste si un job est present en machine
-  bool BatchManager_SGE::isRunning(const JobId & jobid)
+  bool BatchManager_SGE::isRunning(const JobId & /*jobid*/)
   {
     throw NotYetImplementedException("BatchManager_SGE::isRunning");
   }
index 113e99e9bf15ef361323b3e2e2e2840a0ae6f405..4e93051ddae70d514d1869c61f10929281e0346c 100644 (file)
@@ -49,7 +49,7 @@ namespace Batch {
   BatchManager_Vishnu::BatchManager_Vishnu(const FactBatchManager * parent,
                                              const char * host,
                                              const char * username,
-                                             CommunicationProtocolType protocolType,
+                                             CommunicationProtocolType /*protocolType*/,
                                              const char * mpiImpl)
     : // Force SH protocol for Vishnu
       BatchManager(parent, host, username, SH, mpiImpl)