From: Martin Quinson Date: Tue, 21 Nov 2023 13:53:20 +0000 (+0100) Subject: Various sonar cleanups X-Git-Tag: v3.35~8 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/3f9b311ec56db95ec539001a860ae3c838c48312 Various sonar cleanups --- diff --git a/examples/python/comm-ready/comm-ready.py b/examples/python/comm-ready/comm-ready.py index f874bd9748..20065327c5 100644 --- a/examples/python/comm-ready/comm-ready.py +++ b/examples/python/comm-ready/comm-ready.py @@ -58,7 +58,7 @@ def peer(my_id: int, message_count: int, payload_size: int, peers_count: int): start = Engine.clock received: str = my_mailbox.get() waiting_time = Engine.clock - start - if waiting_time != 0.0: + if waiting_time > 0.0: raise AssertionError(f"Expecting the waiting time to be 0.0 because the communication was supposedly " f"ready, but got {waiting_time} instead") this_actor.info(f"I got a '{received}'.") diff --git a/examples/sthread/pthread-mutex-recursive.c b/examples/sthread/pthread-mutex-recursive.c index 482cf3ee7f..63c9cccb23 100644 --- a/examples/sthread/pthread-mutex-recursive.c +++ b/examples/sthread/pthread-mutex-recursive.c @@ -40,7 +40,8 @@ static void* thread_function(void* arg) int main() { - pthread_t thread1, thread2; + pthread_t thread1; + pthread_t thread2; pthread_mutex_t mutex_dflt = PTHREAD_MUTEX_INITIALIZER; // Non-recursive mutex pthread_mutexattr_t attr; diff --git a/include/simgrid/plugins/battery.hpp b/include/simgrid/plugins/battery.hpp index 61937a91a6..fc395053df 100644 --- a/include/simgrid/plugins/battery.hpp +++ b/include/simgrid/plugins/battery.hpp @@ -105,7 +105,7 @@ private: double energy_consumed_j_ = 0; double last_updated_ = 0; - explicit Battery(); + explicit Battery() = default; explicit Battery(const std::string& name, double state_of_charge, double nominal_charge_power_w, double nominal_discharge_power_w, double charge_efficiency, double discharge_efficiency, double initial_capacity_wh, int cycles); @@ -133,7 +133,7 @@ public: void set_load(const std::string& name, double power_w); void set_load(const std::string& name, bool active); void connect_host(s4u::Host* host, bool active = true); - std::string get_name() {return name_;} + std::string get_name() const { return name_; } double get_state_of_charge(); double get_state_of_health(); double get_capacity(); diff --git a/include/simgrid/plugins/chiller.hpp b/include/simgrid/plugins/chiller.hpp index 11fa173477..78d1db0343 100644 --- a/include/simgrid/plugins/chiller.hpp +++ b/include/simgrid/plugins/chiller.hpp @@ -100,7 +100,7 @@ public: double get_temp_in() { return temp_in_c_; } double get_power() { return power_w_; } double get_energy_consumed() { return energy_consumed_j_; } - double get_time_to_goal_temp(); + double get_time_to_goal_temp() const; }; } // namespace simgrid::plugins diff --git a/include/simgrid/s4u/Engine.hpp b/include/simgrid/s4u/Engine.hpp index fbef8cccc9..2bdb4a9cce 100644 --- a/include/simgrid/s4u/Engine.hpp +++ b/include/simgrid/s4u/Engine.hpp @@ -93,8 +93,8 @@ public: /** @verbatim embed:rst:inline Bind an actor name that could be found in :ref:`pf_tag_actor` tag to a class name passed as a template parameter. See the :ref:`example `. @endverbatim */ template void register_actor(const std::string& name) { - kernel::actor::ActorCodeFactory code_factory = [](std::vector args) { - return kernel::actor::ActorCode([args = std::move(args)]() mutable { + kernel::actor::ActorCodeFactory code_factory = [](std::vector args_factory) { + return kernel::actor::ActorCode([args = std::move(args_factory)]() mutable { F code(std::move(args)); code(); }); @@ -104,8 +104,8 @@ public: /** @verbatim embed:rst:inline Bind an actor name that could be found in :ref:`pf_tag_actor` tag to a function name passed as a parameter. See the :ref:`example `. @endverbatim */ template void register_actor(const std::string& name, F code) { - kernel::actor::ActorCodeFactory code_factory = [code](std::vector args) { - return kernel::actor::ActorCode([code, args = std::move(args)]() mutable { code(std::move(args)); }); + kernel::actor::ActorCodeFactory code_factory = [code](std::vector args_factory) { + return kernel::actor::ActorCode([code, args = std::move(args_factory)]() mutable { code(std::move(args)); }); }; register_function(name, code_factory); } diff --git a/include/simgrid/s4u/NetZone.hpp b/include/simgrid/s4u/NetZone.hpp index 76125f3c49..ab535fa289 100644 --- a/include/simgrid/s4u/NetZone.hpp +++ b/include/simgrid/s4u/NetZone.hpp @@ -62,7 +62,7 @@ public: /** @brief Get the gateway associated to this netzone */ kernel::routing::NetPoint* get_gateway() const; kernel::routing::NetPoint* get_gateway(const std::string& name) const; - void set_gateway(s4u::Host* router) { set_gateway(router->get_netpoint()); } + void set_gateway(const s4u::Host* router) { set_gateway(router->get_netpoint()); } void set_gateway(kernel::routing::NetPoint* router); void set_gateway(const std::string& name, kernel::routing::NetPoint* router); diff --git a/include/simgrid/s4u/Task.hpp b/include/simgrid/s4u/Task.hpp index 03ee2653ba..f10729b324 100644 --- a/include/simgrid/s4u/Task.hpp +++ b/include/simgrid/s4u/Task.hpp @@ -64,7 +64,7 @@ protected: virtual void fire(std::string instance); void complete(std::string instance); - void store_activity(ActivityPtr a, std::string instance) { current_activities_[instance].push_back(a); } + void store_activity(ActivityPtr a, const std::string& instance) { current_activities_[instance].push_back(a); } virtual void add_instances(int n); virtual void remove_instances(int n); diff --git a/src/bindings/python/simgrid_python.cpp b/src/bindings/python/simgrid_python.cpp index 41e86465b6..7f5f6b9ed0 100644 --- a/src/bindings/python/simgrid_python.cpp +++ b/src/bindings/python/simgrid_python.cpp @@ -294,7 +294,7 @@ PYBIND11_MODULE(simgrid, m) .def("create_router", &simgrid::s4u::NetZone::create_router, "Create a router") .def("set_parent", &simgrid::s4u::NetZone::set_parent, "Set the parent of this zone") .def("set_property", &simgrid::s4u::NetZone::set_property, "Add a property to this zone") - .def("set_gateway", py::overload_cast(&simgrid::s4u::NetZone::set_gateway), + .def("set_gateway", py::overload_cast(&simgrid::s4u::NetZone::set_gateway), "Specify the gateway of this zone, to be used for inter-zone routes") .def("set_gateway", py::overload_cast(&simgrid::s4u::NetZone::set_gateway), "Specify the gateway of this zone, to be used for inter-zone routes") diff --git a/src/kernel/activity/MutexImpl.hpp b/src/kernel/activity/MutexImpl.hpp index 75cb5d6874..8bf71be533 100644 --- a/src/kernel/activity/MutexImpl.hpp +++ b/src/kernel/activity/MutexImpl.hpp @@ -52,10 +52,10 @@ class XBT_PUBLIC MutexAcquisitionImpl : public ActivityImpl_Tget_id() : 0)) + " mbox:" + - std::to_string(mbox_->get_id()) + " tag: " + std::to_string(tag_) + ")"; + return "CommAsyncSend(comm_id: " + std::to_string(comm_ ? comm_->get_id() : 0) + + " mbox:" + std::to_string(mbox_->get_id()) + " tag: " + std::to_string(tag_) + ")"; } void CommIrecvSimcall::serialize(std::stringstream& stream) const @@ -237,8 +237,8 @@ void CommIrecvSimcall::serialize(std::stringstream& stream) const std::string CommIrecvSimcall::to_string() const { - return "CommAsyncRecv(comm_id: " + std::to_string((comm_ ? comm_->get_id() : 0)) + " mbox:" + - std::to_string(mbox_->get_id()) + " tag: " + std::to_string(tag_) + ")"; + return "CommAsyncRecv(comm_id: " + std::to_string(comm_ ? comm_->get_id() : 0) + + " mbox:" + std::to_string(mbox_->get_id()) + " tag: " + std::to_string(tag_) + ")"; } void MessIputSimcall::serialize(std::stringstream& stream) const diff --git a/src/kernel/actor/SimcallObserver.hpp b/src/kernel/actor/SimcallObserver.hpp index c7d1353620..de3f4fc27c 100644 --- a/src/kernel/actor/SimcallObserver.hpp +++ b/src/kernel/actor/SimcallObserver.hpp @@ -111,7 +111,7 @@ public: class ActorSleepSimcall final : public SimcallObserver { public: - ActorSleepSimcall(ActorImpl* actor) : SimcallObserver(actor) {} + explicit ActorSleepSimcall(ActorImpl* actor) : SimcallObserver(actor) {} void serialize(std::stringstream& stream) const override; std::string to_string() const override; }; diff --git a/src/mc/api/State.cpp b/src/mc/api/State.cpp index 52ffde6044..f537a484b5 100644 --- a/src/mc/api/State.cpp +++ b/src/mc/api/State.cpp @@ -245,7 +245,7 @@ void State::sprout_tree_from_parent_state() "to schedule from the wakeup tree? Trace so far:", get_transition_in()->to_string(false).c_str(), get_transition_in()->aid_, min_process_node.value()->get_action()->to_string(false).c_str(), min_process_node.value()->get_actor()); - for (auto elm : Exploration::get_instance()->get_textual_trace()) + for (auto const& elm : Exploration::get_instance()->get_textual_trace()) XBT_ERROR("%s", elm.c_str()); xbt_abort(); } diff --git a/src/mc/api/strategy/BasicStrategy.hpp b/src/mc/api/strategy/BasicStrategy.hpp index 3d7d01bbd6..ca44509880 100644 --- a/src/mc/api/strategy/BasicStrategy.hpp +++ b/src/mc/api/strategy/BasicStrategy.hpp @@ -31,7 +31,7 @@ public: "--cfg=model-check/max-depth. Here are the 100 first trace elements", _sg_mc_max_depth.get()); auto trace = Exploration::get_instance()->get_textual_trace(100); - for (auto elm : trace) + for (auto const& elm : trace) XBT_CERROR(mc_dfs, " %s", elm.c_str()); xbt_die("Aborting now."); } diff --git a/src/mc/explo/DFSExplorer.cpp b/src/mc/explo/DFSExplorer.cpp index 0466d6654f..b328d15773 100644 --- a/src/mc/explo/DFSExplorer.cpp +++ b/src/mc/explo/DFSExplorer.cpp @@ -433,7 +433,7 @@ void DFSExplorer::backtrack() // Search how to restore the backtracking point std::deque replay_recipe; - for (auto* s = backtracking_point.get(); s != nullptr; s = s->get_parent_state().get()) { + for (const auto* s = backtracking_point.get(); s != nullptr; s = s->get_parent_state().get()) { if (s->get_transition_in() != nullptr) // The root has no transition_in replay_recipe.push_front(s->get_transition_in().get()); } diff --git a/src/mc/transition/TransitionActor.cpp b/src/mc/transition/TransitionActor.cpp index 16a17a3d09..3e1027b576 100644 --- a/src/mc/transition/TransitionActor.cpp +++ b/src/mc/transition/TransitionActor.cpp @@ -49,18 +49,14 @@ bool ActorJoinTransition::depends(const Transition* other) const bool ActorJoinTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::ACTOR_JOIN: - // ActorJoin races with another event iff its target `T` is the same as - // the actor executing the other transition. Clearly, then, we could not join - // on that actor `T` and then run a transition by `T`, so no race is reversible - return false; - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::ACTOR_JOIN, "Unexpected transition type %s", to_c_str(type_)); + + // ActorJoin races with another event iff its target `T` is the same as the actor executing the other transition. + // Clearly, then, we could not join on that actor `T` and then run a transition by `T`, so no race is reversible + return false; } -ActorSleepTransition::ActorSleepTransition(aid_t issuer, int times_considered, std::stringstream& stream) +ActorSleepTransition::ActorSleepTransition(aid_t issuer, int times_considered, std::stringstream&) : Transition(Type::ACTOR_SLEEP, issuer, times_considered) { XBT_DEBUG("ActorSleepTransition()"); @@ -81,12 +77,9 @@ bool ActorSleepTransition::depends(const Transition* other) const bool ActorSleepTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::ACTOR_SLEEP: - return true; // Always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::ACTOR_SLEEP, "Unexpected transition type %s", to_c_str(type_)); + + return true; // Always enabled } } // namespace simgrid::mc diff --git a/src/mc/transition/TransitionAny.cpp b/src/mc/transition/TransitionAny.cpp index 580fb44389..b3c7b63cb3 100644 --- a/src/mc/transition/TransitionAny.cpp +++ b/src/mc/transition/TransitionAny.cpp @@ -45,12 +45,9 @@ bool TestAnyTransition::depends(const Transition* other) const } bool TestAnyTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::TESTANY: - return true; // TestAny is always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::TESTANY, "Unexpected transition type %s", to_c_str(type_)); + + return true; // TestAny is always enabled } WaitAnyTransition::WaitAnyTransition(aid_t issuer, int times_considered, std::stringstream& stream) @@ -81,13 +78,10 @@ bool WaitAnyTransition::depends(const Transition* other) const } bool WaitAnyTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::WAITANY: - // TODO: We need to check if any of the transitions waited on occurred before `e1` - return true; // Let's overapproximate to not miss branches - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::WAITANY, "Unexpected transition type %s", to_c_str(type_)); + + // TODO: We need to check if any of the transitions waited on occurred before `e1` + return true; // Let's overapproximate to not miss branches } } // namespace simgrid::mc diff --git a/src/mc/transition/TransitionComm.cpp b/src/mc/transition/TransitionComm.cpp index 19d8ebfde9..d23cd86fb8 100644 --- a/src/mc/transition/TransitionComm.cpp +++ b/src/mc/transition/TransitionComm.cpp @@ -59,13 +59,10 @@ bool CommWaitTransition::depends(const Transition* other) const bool CommWaitTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::COMM_WAIT: - // If the other event is a communication event, then we are not reversible; otherwise we are reversible. - return other->type_ != Transition::Type::COMM_ASYNC_SEND && other->type_ != Transition::Type::COMM_ASYNC_RECV; - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::COMM_WAIT, "Unexpected transition type %s", to_c_str(type_)); + + // If the other event is a communication event, then we are not reversible; otherwise we are reversible. + return other->type_ != Transition::Type::COMM_ASYNC_SEND && other->type_ != Transition::Type::COMM_ASYNC_RECV; } CommTestTransition::CommTestTransition(aid_t issuer, int times_considered, unsigned comm_, aid_t sender_, @@ -114,12 +111,8 @@ bool CommTestTransition::depends(const Transition* other) const bool CommTestTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::COMM_TEST: - return true; // CommTest is always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::COMM_TEST, "Unexpected transition type %s", to_c_str(type_)); + return true; // CommTest is always enabled } CommRecvTransition::CommRecvTransition(aid_t issuer, int times_considered, unsigned comm_, unsigned mbox_, int tag_) @@ -189,12 +182,9 @@ bool CommRecvTransition::depends(const Transition* other) const bool CommRecvTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::COMM_ASYNC_RECV: - return true; // CommRecv is always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::COMM_ASYNC_RECV, "Unexpected transition type %s", to_c_str(type_)); + + return true; // CommRecv is always enabled } CommSendTransition::CommSendTransition(aid_t issuer, int times_considered, unsigned comm_, unsigned mbox_, int tag_) @@ -265,12 +255,9 @@ bool CommSendTransition::depends(const Transition* other) const bool CommSendTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::COMM_ASYNC_SEND: - return true; // CommSend is always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::COMM_ASYNC_SEND, "Unexpected transition type %s", to_c_str(type_)); + + return true; // CommSend is always enabled } } // namespace simgrid::mc diff --git a/src/mc/transition/TransitionObjectAccess.cpp b/src/mc/transition/TransitionObjectAccess.cpp index 33b4163012..f32e459008 100644 --- a/src/mc/transition/TransitionObjectAccess.cpp +++ b/src/mc/transition/TransitionObjectAccess.cpp @@ -48,12 +48,9 @@ bool ObjectAccessTransition::depends(const Transition* o) const bool ObjectAccessTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::OBJECT_ACCESS: - return true; // Object access is always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::OBJECT_ACCESS, "Unexpected transition type %s", to_c_str(type_)); + + return true; // Object access is always enabled } } // namespace simgrid::mc diff --git a/src/mc/transition/TransitionRandom.cpp b/src/mc/transition/TransitionRandom.cpp index 81eab72a0d..7470be286d 100644 --- a/src/mc/transition/TransitionRandom.cpp +++ b/src/mc/transition/TransitionRandom.cpp @@ -25,12 +25,9 @@ RandomTransition::RandomTransition(aid_t issuer, int times_considered, std::stri bool RandomTransition::reversible_race(const Transition* other) const { - switch (type_) { - case Type::RANDOM: - return true; // Random is always enabled - default: - xbt_die("Unexpected transition type %s", to_c_str(type_)); - } + xbt_assert(type_ == Type::RANDOM, "Unexpected transition type %s", to_c_str(type_)); + + return true; // Random is always enabled } } // namespace simgrid::mc diff --git a/src/plugins/battery.cpp b/src/plugins/battery.cpp index c682e178ac..0cbfdbc8c5 100644 --- a/src/plugins/battery.cpp +++ b/src/plugins/battery.cpp @@ -270,8 +270,6 @@ double Battery::next_occurring_handler() return time_delta; } -Battery::Battery() {} - Battery::Battery(const std::string& name, double state_of_charge, double nominal_charge_power_w, double nominal_discharge_power_w, double charge_efficiency, double discharge_efficiency, double initial_capacity_wh, int cycles) diff --git a/src/plugins/chiller.cpp b/src/plugins/chiller.cpp index 7d2b9de4c7..0a4d3afe4d 100644 --- a/src/plugins/chiller.cpp +++ b/src/plugins/chiller.cpp @@ -283,7 +283,7 @@ ChillerPtr Chiller::remove_host(s4u::Host* host) /** @ingroup plugin_chiller * @return The time to reach to goal temp, assuming that the system remain in the same state. */ -double Chiller::get_time_to_goal_temp() +double Chiller::get_time_to_goal_temp() const { if (goal_temp_c_ == temp_in_c_) return 0; diff --git a/src/s4u/s4u_ActivitySet.cpp b/src/s4u/s4u_ActivitySet.cpp index 92a65cedf0..61957a3f9e 100644 --- a/src/s4u/s4u_ActivitySet.cpp +++ b/src/s4u/s4u_ActivitySet.cpp @@ -103,13 +103,13 @@ ActivityPtr ActivitySet::wait_any_for(double timeout) return ret; } catch (const HostFailureException& e) { handle_failed_activities(); - throw e; + throw; } catch (const NetworkFailureException& e) { handle_failed_activities(); - throw e; + throw; } catch (const StorageFailureException& e) { handle_failed_activities(); - throw e; + throw; } } diff --git a/src/smpi/bindings/smpi_pmpi_request.cpp b/src/smpi/bindings/smpi_pmpi_request.cpp index 73ea9b9b7c..0dc9e32f21 100644 --- a/src/smpi/bindings/smpi_pmpi_request.cpp +++ b/src/smpi/bindings/smpi_pmpi_request.cpp @@ -382,7 +382,7 @@ int PMPI_Sendrecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, int CHECK_BUFFER(1, sendbuf, sendcount, sendtype) CHECK_BUFFER(6, recvbuf, recvcount, recvtype) CHECK_ARGS(sendbuf == recvbuf && sendcount > 0 && recvcount > 0, MPI_ERR_BUFFER, - "%s: Invalid parameters 1 and 6: sendbuf and recvbuf must be disjoint", __func__); + "%s: Invalid parameters 1 and 6: sendbuf and recvbuf must be disjoint", __func__) CHECK_TAG(10, recvtag) CHECK_COMM(11) const SmpiBenchGuard suspend_bench; @@ -443,7 +443,7 @@ int PMPI_Isendrecv(const void* sendbuf, int sendcount, MPI_Datatype sendtype, in CHECK_BUFFER(1, sendbuf, sendcount, sendtype) CHECK_BUFFER(6, recvbuf, recvcount, recvtype) CHECK_ARGS(sendbuf == recvbuf && sendcount > 0 && recvcount > 0, MPI_ERR_BUFFER, - "%s: Invalid parameters 1 and 6: sendbuf and recvbuf must be disjoint", __func__); + "%s: Invalid parameters 1 and 6: sendbuf and recvbuf must be disjoint", __func__) CHECK_TAG(10, recvtag) CHECK_COMM(11) CHECK_REQUEST(12) diff --git a/src/sthread/sthread.c b/src/sthread/sthread.c index af260220f2..ad27e3fa1d 100644 --- a/src/sthread/sthread.c +++ b/src/sthread/sthread.c @@ -30,7 +30,7 @@ static int (*raw_pthread_mutex_destroy)(pthread_mutex_t*); static int (*raw_pthread_mutexattr_init)(pthread_mutexattr_t*); static int (*raw_pthread_mutexattr_settype)(pthread_mutexattr_t*, int); -static int (*raw_pthread_mutexattr_gettype)(const pthread_mutexattr_t* restrict, int* restrict); +static int (*raw_pthread_mutexattr_gettype)(const pthread_mutexattr_t*, int*); static int (*raw_pthread_mutexattr_getrobust)(const pthread_mutexattr_t*, int*); static int (*raw_pthread_mutexattr_setrobust)(pthread_mutexattr_t*, int); @@ -125,12 +125,12 @@ void sthread_disable(void) intercepted_pthcall(mutexattr_init, (pthread_mutexattr_t * attr), (attr), ((sthread_mutexattr_t*)attr)); intercepted_pthcall(mutexattr_settype, (pthread_mutexattr_t * attr, int type), (attr, type), ((sthread_mutexattr_t*)attr, type)); -intercepted_pthcall(mutexattr_gettype, (const pthread_mutexattr_t* restrict attr, int* type), (attr, type), +intercepted_pthcall(mutexattr_gettype, (const pthread_mutexattr_t* attr, int* type), (attr, type), ((sthread_mutexattr_t*)attr, type)); -intercepted_pthcall(mutexattr_setrobust, (pthread_mutexattr_t* restrict attr, int robustness), (attr, robustness), +intercepted_pthcall(mutexattr_setrobust, (pthread_mutexattr_t * attr, int robustness), (attr, robustness), + ((sthread_mutexattr_t*)attr, robustness)); +intercepted_pthcall(mutexattr_getrobust, (const pthread_mutexattr_t* attr, int* robustness), (attr, robustness), ((sthread_mutexattr_t*)attr, robustness)); -intercepted_pthcall(mutexattr_getrobust, (const pthread_mutexattr_t* restrict attr, int* restrict robustness), - (attr, robustness), ((sthread_mutexattr_t*)attr, robustness)); intercepted_pthcall(create, (pthread_t * thread, const pthread_attr_t* attr, void* (*start_routine)(void*), void* arg), (thread, attr, start_routine, arg), ((sthread_t*)thread, attr, start_routine, arg));