From: Arnaud Giersch Date: Fri, 6 Mar 2020 14:51:03 +0000 (+0100) Subject: Please sonar. X-Git-Tag: v3.26~775 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/c798920baebe0b62821de2476494f4a1a0f1bcd7 Please sonar. Since PTH_STACKGROWPTH if a compile-time constant, it warned for: - "code will never be executed", and - "identical sub-expressions on both sides of operator '=='" --- diff --git a/src/kernel/context/ContextSwapped.cpp b/src/kernel/context/ContextSwapped.cpp index 7b25012c58..5a54a95109 100644 --- a/src/kernel/context/ContextSwapped.cpp +++ b/src/kernel/context/ContextSwapped.cpp @@ -170,7 +170,11 @@ SwappedContext::~SwappedContext() unsigned char* SwappedContext::get_stack_bottom() const { // Depending on the stack direction, its bottom (that make_fcontext needs) may be the lower or higher end - return PTH_STACKGROWTH == -1 ? stack_ + get_actor()->get_stacksize() : stack_; +#if PTH_STACKGROWTH == 1 + return stack_; +#else + return stack_ + get_actor()->get_stacksize(); +#endif } void SwappedContext::stop()