[Openmp-commits] [PATCH] D90967: [OpenMP] Add OpenMP 5.1 omp_calloc function implementation

Joachim Protze via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue Nov 17 03:48:39 PST 2020


protze.joachim added a comment.

Testing with `cmake . -DOPENMP_TEST_FLAGS="-Werror -Wno-#warnings" && ninja check-libomp` breaks for the newly added tests.



================
Comment at: openmp/runtime/test/api/omp_calloc_def_fb.c:15
+  a = omp_init_allocator(omp_large_cap_mem_space, 2, at);
+  printf("allocator large created: %p\n", a);
+  #pragma omp parallel num_threads(2)
----------------
The compiler complains:
```
llvm-project/openmp/runtime/test/api/omp_calloc_def_fb.c:15:43: error: format specifies type 'void *' but the argument has underlying type 'unsigned long' [-Werror,-Wformat]
  printf("allocator large created: %p\n", a);
                                   ~~     ^
                                   %lu
```



================
Comment at: openmp/runtime/test/api/omp_calloc_size_0.c:16
+  a = omp_init_allocator(omp_large_cap_mem_space, 2, at);
+  printf("allocator large created: %p\n", a);
+  #pragma omp parallel num_threads(2)
----------------
Similarly:
```
llvm-project/openmp/runtime/test/api/omp_calloc_size_0.c:16:43: error: format specifies type 'void *' but the argument has underlying type 'unsigned long' [-Werror,-Wformat]
  printf("allocator large created: %p\n", a);
                                   ~~     ^
                                   %lu
```
Cast to (void *) seems reasonable, if you want to print as a pointer.



Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90967/new/

https://reviews.llvm.org/D90967



More information about the Openmp-commits mailing list