Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
attempt to get rid of all const_cast (take 2)
[simgrid.git] / src / smpi / smpi_global.cpp
index 161300d..ff2da6f 100644 (file)
@@ -489,10 +489,11 @@ typedef void (*smpi_fortran_entry_point_type)();
 
 static int smpi_run_entry_point(smpi_entry_point_type entry_point, std::vector<std::string> args)
 {
+  char noarg[]   = {'\0'};
   const int argc = args.size();
   std::unique_ptr<char*[]> argv(new char*[argc + 1]);
   for (int i = 0; i != argc; ++i)
-    argv[i] = args[i].empty() ? const_cast<char*>(""): &args[i].front();
+    argv[i] = args[i].empty() ? noarg : &args[i].front();
   argv[argc] = nullptr;
 
   int res = entry_point(argc, argv.get());