I just tried to port the new version 8.1.1 to my hobby project.
I use the toolchain Sourcery CodeBench Lite Edition for ARM EABI (GCC based, for ARM), my compiler settings are very strict (each warning is treated as an error) and it returns the following error when compiling tasks.c:
arm-none-eabi-gcc -c -mcpu=arm926ej-s -Wall -Wextra -Werror -IFreeRTOS/Source/include/ -IDemo/ -IFreeRTOS/Source/portable/GCC/ARM926EJ-S/ FreeRTOS/Source/tasks.c -o obj/tasks.o FreeRTOS/Source/tasks.c: In function 'pvTaskIncrementMutexHeldCount': FreeRTOS/Source/tasks.c:3604:1: error: control reaches end of non-void function [-Werror=return-type] cc1: all warnings being treated as errors
In other words, when configUSE_MUTEXES is not set, the function pvTaskIncrementMutexHeldCount does not return anzthing although it is declared to return a void* casted pointer.
My temporary workaround is to return NULL in such cases (as implemented here). Anyway, I would like to hear what is supposed to be returned at such an occasion (maybe pxCurrentTCB?) so that I can fix it ASAP.
BTW, how come, this wasn’t detected by compilers that support MISRA standards?