[Openmp-commits] [openmp] 3f25ad3 - [OpenMP] Fix warnings about unused expressions when OMPT_LOOP_DISPATCH is a no-op. NFC.

Martin Storsjö via Openmp-commits openmp-commits at lists.llvm.org
Tue Aug 2 01:16:35 PDT 2022


Author: Martin Storsjö
Date: 2022-08-02T11:16:23+03:00
New Revision: 3f25ad335b4ef882cd4e336f9d9ac1606220f572

URL: https://github.com/llvm/llvm-project/commit/3f25ad335b4ef882cd4e336f9d9ac1606220f572
DIFF: https://github.com/llvm/llvm-project/commit/3f25ad335b4ef882cd4e336f9d9ac1606220f572.diff

LOG: [OpenMP] Fix warnings about unused expressions when OMPT_LOOP_DISPATCH is a no-op. NFC.

This fixes warnings like these:

../runtime/src/kmp_dispatch.cpp:2159:24: warning: left operand of comma operator has no effect [-Wunused-value]
    OMPT_LOOP_DISPATCH(*p_lb, *p_ub, pr->u.p.st, status);
                       ^~~~~
../runtime/src/kmp_dispatch.cpp:2159:31: warning: left operand of comma operator has no effect [-Wunused-value]
    OMPT_LOOP_DISPATCH(*p_lb, *p_ub, pr->u.p.st, status);
                              ^~~~~
../runtime/src/kmp_dispatch.cpp:2159:46: warning: left operand of comma operator has no effect [-Wunused-value]
    OMPT_LOOP_DISPATCH(*p_lb, *p_ub, pr->u.p.st, status);
                                     ~~~~~~~ ^~
../runtime/src/kmp_dispatch.cpp:2159:50: warning: expression result unused [-Wunused-value]
    OMPT_LOOP_DISPATCH(*p_lb, *p_ub, pr->u.p.st, status);
                                                 ^~~~~~

Added: 
    

Modified: 
    openmp/runtime/src/kmp_dispatch.cpp

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp
index e7d28c6587b1..c8c8ff8065fc 100644
--- a/openmp/runtime/src/kmp_dispatch.cpp
+++ b/openmp/runtime/src/kmp_dispatch.cpp
@@ -1979,7 +1979,7 @@ int __kmp_dispatch_next_algorithm(int gtid,
 // TODO: implement count
 #else
 #define OMPT_LOOP_END // no-op
-#define OMPT_LOOP_DISPATCH // no-op
+#define OMPT_LOOP_DISPATCH(lb, ub, st, status) // no-op
 #endif
 
 #if KMP_STATS_ENABLED


        


More information about the Openmp-commits mailing list