From e29759d877a2c4dceafc06f10d2c5636cac4025a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 22 Dec 2021 13:26:26 +0100 Subject: [PATCH] WorkQueueManager: explicitly convert PTHREAD_STACK_MIN to int MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fixes a compiler error on GCC 11.2.1: error: no matching function for call to ‘max(long int, int)’ --- platforms/common/px4_work_queue/WorkQueueManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platforms/common/px4_work_queue/WorkQueueManager.cpp b/platforms/common/px4_work_queue/WorkQueueManager.cpp index 9263cbd926..b31c7118fe 100644 --- a/platforms/common/px4_work_queue/WorkQueueManager.cpp +++ b/platforms/common/px4_work_queue/WorkQueueManager.cpp @@ -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