[Openmp-commits] [openmp] r351323 - [OpenMP] Remove compiler warning about unused value

Joachim Protze via Openmp-commits openmp-commits at lists.llvm.org
Wed Jan 16 03:35:12 PST 2019


Author: jprotze
Date: Wed Jan 16 03:35:11 2019
New Revision: 351323

URL: http://llvm.org/viewvc/llvm-project?rev=351323&view=rev
Log:
[OpenMP] Remove compiler warning about unused value

The compiler warns about an unused variable/statement:

    runtime/src/kmp_affinity.cpp:4958:18: warning: statement has no effect [-Wunused-value]
       KA_TRACE(1000, ; {
                      ^
    runtime/src/kmp_debug.h:84:24: note: in definition of macro 'KA_TRACE'
         __kmp_debug_printf x;                                                      \
                            ^

Instead of the unused reference to this function, this patch now calls the function
with an empty string. The call to this function should have no effect.

Patch provided by joachim.protze

Reviewers: jlpeyton, hbae, AndreyChurbanov

Reviewed By: AndreyChurbanov

Tags: #openmp, #ompt

Differential Revision: https://reviews.llvm.org/D56775

Modified:
    openmp/trunk/runtime/src/kmp_affinity.cpp

Modified: openmp/trunk/runtime/src/kmp_affinity.cpp
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_affinity.cpp?rev=351323&r1=351322&r2=351323&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_affinity.cpp (original)
+++ openmp/trunk/runtime/src/kmp_affinity.cpp Wed Jan 16 03:35:11 2019
@@ -4885,7 +4885,7 @@ int __kmp_aux_set_affinity(void **mask)
   }
 
   gtid = __kmp_entry_gtid();
-  KA_TRACE(1000, ; {
+  KA_TRACE(1000, (""); {
     char buf[KMP_AFFIN_MASK_PRINT_LEN];
     __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
                               (kmp_affin_mask_t *)(*mask));
@@ -4955,7 +4955,7 @@ int __kmp_aux_get_affinity(void **mask)
   th = __kmp_threads[gtid];
   KMP_DEBUG_ASSERT(th->th.th_affin_mask != NULL);
 
-  KA_TRACE(1000, ; {
+  KA_TRACE(1000, (""); {
     char buf[KMP_AFFIN_MASK_PRINT_LEN];
     __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
                               th->th.th_affin_mask);
@@ -4972,7 +4972,7 @@ int __kmp_aux_get_affinity(void **mask)
 #if !KMP_OS_WINDOWS
 
   retval = __kmp_get_system_affinity((kmp_affin_mask_t *)(*mask), FALSE);
-  KA_TRACE(1000, ; {
+  KA_TRACE(1000, (""); {
     char buf[KMP_AFFIN_MASK_PRINT_LEN];
     __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
                               (kmp_affin_mask_t *)(*mask));
@@ -5006,7 +5006,7 @@ int __kmp_aux_set_affinity_mask_proc(int
     return -1;
   }
 
-  KA_TRACE(1000, ; {
+  KA_TRACE(1000, (""); {
     int gtid = __kmp_entry_gtid();
     char buf[KMP_AFFIN_MASK_PRINT_LEN];
     __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
@@ -5038,7 +5038,7 @@ int __kmp_aux_unset_affinity_mask_proc(i
     return -1;
   }
 
-  KA_TRACE(1000, ; {
+  KA_TRACE(1000, (""); {
     int gtid = __kmp_entry_gtid();
     char buf[KMP_AFFIN_MASK_PRINT_LEN];
     __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,
@@ -5070,7 +5070,7 @@ int __kmp_aux_get_affinity_mask_proc(int
     return -1;
   }
 
-  KA_TRACE(1000, ; {
+  KA_TRACE(1000, (""); {
     int gtid = __kmp_entry_gtid();
     char buf[KMP_AFFIN_MASK_PRINT_LEN];
     __kmp_affinity_print_mask(buf, KMP_AFFIN_MASK_PRINT_LEN,




More information about the Openmp-commits mailing list