MISRA Discussion Forums

Full Version: MISRA C:1998 Rule 113
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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

OSInsPrioQ(OScTcbP, &(ecbP->tcbP));

whereas it's fine with

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.

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.
Thanks -- obviously there are tool issues to contend with as well as simply understanding the intent of the rules themselves.