This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] libomp: fix warning on comparison of integer expressions of different signedness
ClosedPublic

Authored by AndreyChurbanov on Oct 11 2021, 10:25 AM.

Details

Summary

Luke Benes <lukebenes@hotmail.com> reported the warning:

[2685/5155] Building CXX object projects/openmp/runtime/src/CMakeFiles/omp.dir/kmp_settings.cpp.o
/llvm-project/openmp/runtime/src/kmp_settings.cpp: In function ‘void __kmp_check_stksize(size_t*)’:
/llvm-project/openmp/runtime/src/kmp_settings.cpp:305:12: warning: comparison of integer expressions of different signedness: ‘size_t’ {aka ‘long unsigned int’} and ‘long int’ [-Wsign-compare]

305 |   if (*val < KMP_MIN_STKSIZE)

The patch replaces macro with global variable.

Diff Detail

Event Timeline

AndreyChurbanov requested review of this revision.Oct 11 2021, 10:25 AM
lbenes added a subscriber: lbenes.Oct 12 2021, 7:21 PM

I can confirm this patch does resolve the gcc-11 warning.

This revision is now accepted and ready to land.Oct 13 2021, 9:19 AM