Page MenuHomePhabricator

[OpenMP] Fix issue with directives used in a macro.
ClosedPublic

Authored by sfantao on Oct 20 2016, 5:29 AM.

Details

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.

Event Timeline

sfantao updated this revision to Diff 75288.Oct 20 2016, 5:29 AM
sfantao retitled this revision from to [OpenMP] Fix issue with directives used in a macro..
sfantao updated this object.
sfantao added a subscriber: openmp-commits.

I think the format strings and arguments should be reformatted as they where before rL283577

sfantao updated this revision to Diff 75290.Oct 20 2016, 6:23 AM
sfantao updated this object.
  • Use string format used before.
Hahnfeld accepted this revision.Oct 20 2016, 6:25 AM
Hahnfeld added a reviewer: Hahnfeld.

LGTM

This revision is now accepted and ready to land.Oct 20 2016, 6:25 AM

Hi Jonas,

Thanks for the quick review!

I think the format strings and arguments should be reformatted as they where before rL283577

Sure, it makes sense. Fixed it in the last diff. It is not exactly the same as before as I am using LLVM code style guidelines in this change.

Thanks again!
Samuel

sfantao closed this revision.Oct 20 2016, 6:29 AM