[Openmp-commits] [PATCH] D65284: [OpenMP] Fix build of stubs library

Jonas Hahnfeld via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Thu Jul 25 08:55:12 PDT 2019


Hahnfeld created this revision.
Hahnfeld added reviewers: jlpeyton, tlwilmar, AndreyChurbanov.
Herald added subscribers: openmp-commits, guansong.
Herald added a reviewer: jdoerfert.
Herald added a project: OpenMP.

Both Clang and GCC complained that they cannot initialize a return
object of type 'kmp_proc_bind_t' with an 'int'. While at it, also
fix a warning about missing parentheses thrown by Clang.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65284

Files:
  openmp/runtime/src/kmp_stub.cpp


Index: openmp/runtime/src/kmp_stub.cpp
===================================================================
--- openmp/runtime/src/kmp_stub.cpp
+++ openmp/runtime/src/kmp_stub.cpp
@@ -164,7 +164,7 @@
 #if KMP_OS_WINDOWS
   res = _aligned_malloc(sz, a);
 #else
-  if (err = posix_memalign(&res, a, sz)) {
+  if ((err = posix_memalign(&res, a, sz))) {
     errno = err; // can be EINVAL or ENOMEM
     res = NULL;
   }
@@ -277,7 +277,7 @@
 
 kmp_proc_bind_t __kmps_get_proc_bind(void) {
   i;
-  return 0;
+  return proc_bind_false;
 } // __kmps_get_proc_bind
 
 double __kmps_get_wtime(void) {


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65284.211766.patch
Type: text/x-patch
Size: 592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20190725/a5b4e968/attachment-0001.bin>


More information about the Openmp-commits mailing list