Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MISRA C:1998 Rule 113
#1
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
<t></t>
Reply
#2
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.
<t>Gavin McCall<br/>
Personal view only.</t>
Reply
#3
Thanks -- obviously there are tool issues to contend with as well as simply understanding the intent of the rules themselves.

--Andrew
<t></t>
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)