Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Remove ancient hack.
[simgrid.git] / src / bindings / python / simgrid_python.cpp
index adb7be8..62c395a 100644 (file)
@@ -3,20 +3,11 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
-#if defined(__GNUG__)
-#pragma GCC diagnostic push
-#pragma GCC diagnostic ignored "-Wunused-value"
-#endif
-
 #include <pybind11/pybind11.h> // Must come before our own stuff
 
 #include <pybind11/functional.h>
 #include <pybind11/stl.h>
 
-#if defined(__GNUG__)
-#pragma GCC diagnostic pop
-#endif
-
 #include "simgrid/kernel/ProfileBuilder.hpp"
 #include "simgrid/kernel/routing/NetPoint.hpp"
 #include <simgrid/Exception.hpp>
@@ -459,7 +450,7 @@ PYBIND11_MODULE(simgrid, m)
             Host::on_creation_cb([cb_p = cb.ptr()](Host& h) {
               const py::gil_scoped_acquire py_context; // need a new context for callback
               try {
-                py::function fun = py::reinterpret_borrow<py::function>(cb_p);
+                const auto fun = py::reinterpret_borrow<py::function>(cb_p);
                 fun(&h);
               } catch (const py::error_already_set& e) {
                 xbt_die("Error while executing the on_creation lambda : %s", e.what());