I’m trying to evaluate the comparability of FreeRTOS with the MISRA-C 2012 guidelines to see if it would fit a project we’re working on.
I know that you’ve made a great effort to conform to the guidelines and document exceptions as required, and we really do appreciate that!
I did however encounter many instances where rule 11.3 is not met and the exception is not documented. I wanted to know if this is perhaps a misunderstanding of mine (and our MISRA-checking tool) or if this is indeed the case.
The rule states that “A cast shall not be performed between a pointer to object type and a pointer to a different object type”. The rule also states that the only exception to this is casting to a pointer to char, signed char or unsigned char.
There are, however, many lines such as:
Queue_t * const pxQueue = ( Queue_t * ) xQueue;
in the FreeRTOS code.
The problem here is the xQueue pointer (QueueHandle_t, a void * pointer) being converted to a Queue_t pointer which points to a structure.
I’d like to hear your opinion on this and please do let me know if I got this wrong.
Thank you very much in advance!