[Openmp-commits] [openmp] r284728 - [OpenMP] Fix issue with directives used in a macro.

Samuel Antao via Openmp-commits openmp-commits at lists.llvm.org
Thu Oct 20 06:20:17 PDT 2016


Author: sfantao
Date: Thu Oct 20 08:20:17 2016
New Revision: 284728

URL: http://llvm.org/viewvc/llvm-project?rev=284728&view=rev
Log:
[OpenMP] Fix issue with directives used in a macro.

Summary:
If directives are used in a macro, clang complains with:
```
src/projects/openmp/runtime/src/kmp_runtime.c:7486:2: error: embedding a directive within macro arguments has undefined behavior [-Werror,-Wembedded-directive]
#if KMP_USE_MONITOR
```

This patch fixes two occurrences of the issue in `kmp_runtime.cpp`.

Reviewers: tlwilmar, jlpeyton, AndreyChurbanov, Hahnfeld

Subscribers: Hahnfeld, openmp-commits

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

Modified:
    openmp/trunk/runtime/src/kmp_runtime.c

Modified: openmp/trunk/runtime/src/kmp_runtime.c
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/kmp_runtime.c?rev=284728&r1=284727&r2=284728&view=diff
==============================================================================
--- openmp/trunk/runtime/src/kmp_runtime.c (original)
+++ openmp/trunk/runtime/src/kmp_runtime.c Thu Oct 20 08:20:17 2016
@@ -7482,16 +7482,17 @@ __kmp_aux_set_blocktime (int arg, kmp_in
 
     set__bt_set_team( thread->th.th_team, tid, bt_set );
     set__bt_set_team( thread->th.th_serial_team, 0, bt_set );
-    KF_TRACE(10, ( "kmp_set_blocktime: T#%d(%d:%d), blocktime=%d"
 #if KMP_USE_MONITOR
-                   ", bt_intervals=%d, monitor_updates=%d"
+    KF_TRACE(10, ("kmp_set_blocktime: T#%d(%d:%d), blocktime=%d, "
+                  "bt_intervals=%d, monitor_updates=%d\n",
+                  __kmp_gtid_from_tid(tid, thread->th.th_team),
+                  thread->th.th_team->t.t_id, tid, blocktime, bt_intervals,
+                  __kmp_monitor_wakeups));
+#else
+    KF_TRACE(10, ("kmp_set_blocktime: T#%d(%d:%d), blocktime=%d\n",
+                  __kmp_gtid_from_tid(tid, thread->th.th_team),
+                  thread->th.th_team->t.t_id, tid, blocktime));
 #endif
-                   "\n",
-                   __kmp_gtid_from_tid(tid, thread->th.th_team), thread->th.th_team->t.t_id, tid, blocktime
-#if KMP_USE_MONITOR
-                   , bt_intervals, __kmp_monitor_wakeups
-#endif
-                 ) );
 }
 
 void




More information about the Openmp-commits mailing list