From 7508c42cf81d24b37fa312ccce0c574d137fe866 Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Thu, 26 Nov 2020 21:58:48 +0100 Subject: [PATCH] Use a local variable, and hope to fix PVS-studio warning. E.g., at smpi_pmpi_request.cpp:50 V501 There are identical sub-expressions to the left and to the right of the '!=' operator: ((MPI_SUCCESS)) != MPI_SUCCESS --- src/smpi/include/private.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/smpi/include/private.hpp b/src/smpi/include/private.hpp index c2bc1082d9..c9635c4f1b 100644 --- a/src/smpi/include/private.hpp +++ b/src/smpi/include/private.hpp @@ -515,12 +515,12 @@ XBT_PUBLIC smpi_trace_call_location_t* smpi_trace_get_call_location(); XBT_PRIVATE void private_execute_flops(double flops); - #define CHECK_ARGS(test, errcode, ...) \ if (test) { \ - if((errcode) != MPI_SUCCESS) \ + int error_code_ = (errcode); \ + if (error_code_ != MPI_SUCCESS) \ XBT_WARN(__VA_ARGS__); \ - return (errcode); \ + return error_code_; \ } #define CHECK_MPI_NULL(num, val, err, ptr) \ -- 2.20.1