WorkQueueManager: explicitly convert PTHREAD_STACK_MIN to int

fixes a compiler error on GCC 11.2.1:
error: no matching function for call to ‘max(long int, int)’
This commit is contained in:
Beat Küng 2021-12-22 13:26:26 +01:00 committed by Daniel Agar
parent 2c8a92c628
commit e29759d877
1 changed files with 1 additions and 1 deletions

View File

@ -268,7 +268,7 @@ WorkQueueManagerRun(int, char **)
// On posix system , the desired stacksize round to the nearest multiplier of the system pagesize
// It is a requirement of the pthread_attr_setstacksize* function
const unsigned int page_size = sysconf(_SC_PAGESIZE);
const size_t stacksize_adj = math::max(PTHREAD_STACK_MIN, PX4_STACK_ADJUSTED(wq->stacksize));
const size_t stacksize_adj = math::max((int)PTHREAD_STACK_MIN, PX4_STACK_ADJUSTED(wq->stacksize));
const size_t stacksize = (stacksize_adj + page_size - (stacksize_adj % page_size));
#endif