Browse Source

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)’
master
Beat Küng 3 years ago committed by Daniel Agar
parent
commit
e29759d877
  1. 2
      platforms/common/px4_work_queue/WorkQueueManager.cpp

2
platforms/common/px4_work_queue/WorkQueueManager.cpp

@ -268,7 +268,7 @@ WorkQueueManagerRun(int, char **) @@ -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

Loading…
Cancel
Save