In file src/vos/posix/vos_thread.c the following initialization is performed:
const size_t cDefaultStackSize = 4u * PTHREAD_STACK_MIN;
In glibc versions over 2.34, PTHREAD_STACK_MIN macro can not be considered as constant, since it is defined as follows:
# define PTHREAD_STACK_MIN __sysconf (__SC_THREAD_STACK_MIN_VALUE)
In theory, sysconf can return -1, so the compiler claims that initialization is not constant:
src/vos/posix/vos_thread.c:81:39: error: initializer element is not constant
81 | const size_t cDefaultStackSize = 4u * PTHREAD_STACK_MIN;
A temporal fix is to change cDefaultStackSize initialization with a define like the following:
#define cDefaultStackSize (4u * PTHREAD_STACK_MIN)
No patch is provided since it would be needed to analize implications of this workaround.
Regards,
Adrian
... yes, already saw same here with Ubuntu 22.04 and gcc-11
Patched like proposed. Additional check of cDefaultStackSize added.
Definition of the default stack size changed fom constand to #define and additional check added.