Skip to content

Commit 3351519

Browse files
author
Samuel Antao
committedOct 20, 2016
[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 llvm-svn: 284728
1 parent 7c870a7 commit 3351519

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed
 

‎openmp/runtime/src/kmp_runtime.c

+9-8
Original file line numberDiff line numberDiff line change
@@ -7482,16 +7482,17 @@ __kmp_aux_set_blocktime (int arg, kmp_info_t *thread, int tid)
74827482

74837483
set__bt_set_team( thread->th.th_team, tid, bt_set );
74847484
set__bt_set_team( thread->th.th_serial_team, 0, bt_set );
7485-
KF_TRACE(10, ( "kmp_set_blocktime: T#%d(%d:%d), blocktime=%d"
74867485
#if KMP_USE_MONITOR
7487-
", bt_intervals=%d, monitor_updates=%d"
7488-
#endif
7489-
"\n",
7490-
__kmp_gtid_from_tid(tid, thread->th.th_team), thread->th.th_team->t.t_id, tid, blocktime
7491-
#if KMP_USE_MONITOR
7492-
, bt_intervals, __kmp_monitor_wakeups
7486+
KF_TRACE(10, ("kmp_set_blocktime: T#%d(%d:%d), blocktime=%d, "
7487+
"bt_intervals=%d, monitor_updates=%d\n",
7488+
__kmp_gtid_from_tid(tid, thread->th.th_team),
7489+
thread->th.th_team->t.t_id, tid, blocktime, bt_intervals,
7490+
__kmp_monitor_wakeups));
7491+
#else
7492+
KF_TRACE(10, ("kmp_set_blocktime: T#%d(%d:%d), blocktime=%d\n",
7493+
__kmp_gtid_from_tid(tid, thread->th.th_team),
7494+
thread->th.th_team->t.t_id, tid, blocktime));
74937495
#endif
7494-
) );
74957496
}
74967497

74977498
void

0 commit comments

Comments
 (0)
Please sign in to comment.