Skip to content
Commit 9b8c353c authored by Dimitry Andric's avatar Dimitry Andric
Browse files

On FreeBSD, PTHREADS_THREADS_MAX does not fit into an int, leading to

warnings similar to the following:

    runtime/src/kmp_global.c:117:35: warning: implicit conversion from
    'unsigned long' to 'int' changes value from 18446744073709551615 to -1
    [-Wconstant-conversion]
    int           __kmp_sys_max_nth = KMP_MAX_NTH;
                  ~~~~~~~~~~~~~~~~~   ^~~~~~~~~~~
    runtime/src/kmp.h:849:34: note: expanded from macro 'KMP_MAX_NTH'
    #    define KMP_MAX_NTH          PTHREAD_THREADS_MAX
                                     ^~~~~~~~~~~~~~~~~~~

Clamp KMP_MAX_NTH to INT_MAX to avoid these warnings.  Also use INT_MAX
whenever PTHREAD_THREADS_MAX is not defined at all.

Differential Revision: http://reviews.llvm.org/D13827

llvm-svn: 250708
parent 3cb667ed
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment