/*
* Defines the prototype to which task functions must conform. Defined in this
* file to ensure the type is known before portable.h is included.
*/
typedef void (*TaskFunction_t)( void * );
so, the Form of a Task is:
void vTaskCode( void * pvParameters )
nothing else.
SonarLint gives a
Make the type of this parameter a pointer-to-const. The current type of pvParameter is void *.
Which is not helpful here.
This is a false positive in the MISRA strict rule: it does not make an exception for functions passed as callbacks, as in your case.
I agree that if vTaskCode is passed as an argument that has a fixed type, such as TaskFunction_t, the rule must not raise an issue regarding its signature.
Thank you for reporting this case. Unfortunately, we cannot change the strict MISRA rule because then it will no longer correspond to the MISRA standard. We can, however, implement a similar rule, that would correctly make an exception in the case you reported. I created a ticket for it, to be evaluated whether it is a reasonable thing to do.
BTW, your example helped me to spot another false positive with a similar problem: S5008. Fortunately, we are free to improve this rule as we wish, so here is the ticket.