MISRA C:1998 Rule 113 - Printable Version +- MISRA Discussion Forums (https://forum.misra.org.uk) +-- Forum: MISRA C (https://forum.misra.org.uk/forumdisplay.php?fid=4) +--- Forum: General Questions (https://forum.misra.org.uk/forumdisplay.php?fid=27) +--- Thread: MISRA C:1998 Rule 113 (/showthread.php?tid=31) |
MISRA C:1998 Rule 113 - aekalman - 15-06-2005 Hello All. I am running the comercial RTOS Salvo through the MISRA checker as implemented in IAR's EWARM v4.20A tool suite. I have a struct called ecb which in turn contains a field called tcbP. ecbP is a pointer to the struct ecb. OSeligQP is a pointer to a struct tcb. The IAR MISRA checker complains about a call to a function Code: OSInsPrioQ(OScTcbP, &(ecbP->tcbP)); whereas it's fine with Code: OSInsPrioQ(OScTcbP, &OSeligQP); Now, I admit that I do not know MISRA views passing a parameter by reference, but it certainly doesn't disallow it. In my example, a member of a struct is being passed by reference (not by value), and is being accessed by name, as per MISRA. So, is this legal in MISRA-C? Thanks for any and all input. --Andrew - Gavin McCall - 03-11-2005 MISRA C Steering Team 2/11/2005 It is not entirely apparent from your question what the tool is complaining about. Rule 113 was not intended to preclude the use of the address of a structure member. The intent of Rule 113 was to prevent the addressing of unnamed members of a structure. Rule 113 is rescinded in MISRA-C:2004. - aekalman - 07-11-2005 Thanks -- obviously there are tool issues to contend with as well as simply understanding the intent of the rules themselves. --Andrew |