From 00ad8d1c4ad16896a0d835e96971de83443a8295 Mon Sep 17 00:00:00 2001 From: Augustin Degomme Date: Sat, 6 Apr 2019 12:40:12 +0200 Subject: [PATCH] most linuxes seem to prefer resetting this value at 0 to initiate some cleanups from the manpage : (Resetting to 0 forces the invocation of an internal initialization routine that rechecks POSIXLY_CORRECT and checks for GNU extensions in optstring.) --- src/smpi/include/smpi_actor.hpp | 6 +++++- src/smpi/internals/smpi_actor.cpp | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/smpi/include/smpi_actor.hpp b/src/smpi/include/smpi_actor.hpp index 97d4d2b1f1..098642963f 100644 --- a/src/smpi/include/smpi_actor.hpp +++ b/src/smpi/include/smpi_actor.hpp @@ -31,7 +31,11 @@ class ActorExt { smpi_trace_call_location_t trace_call_loc_; s4u::ActorPtr actor_ = nullptr; smpi_privatization_region_t privatized_region_ = nullptr; - int optind = 1; /*for getopt replacement */ +#ifdef __linux__ + int optind_ = 0; /*for getopt replacement */ +#else + int optind_ = 1; /*for getopt replacement */ +#endif std::string tracing_category_ = ""; #if HAVE_PAPI diff --git a/src/smpi/internals/smpi_actor.cpp b/src/smpi/internals/smpi_actor.cpp index e657ab901b..0a9a96d395 100644 --- a/src/smpi/internals/smpi_actor.cpp +++ b/src/smpi/internals/smpi_actor.cpp @@ -246,11 +246,11 @@ void ActorExt::init() int ActorExt::get_optind() { - return optind; + return optind_; } void ActorExt::set_optind(int new_optind) { - optind = new_optind; + optind_ = new_optind; } } // namespace smpi -- 2.20.1